Results 1 to 3 of 3

Thread: data from multiple catalogs in one listing

  1. #1
    New user
    Join Date
    07-10-11.
    Posts
    1

    Default data from multiple catalogs in one listing

    Hi there,

    I have the following catalogs: events, locations, countries.
    The events have a select box for selecting the location. The locations have a select box for selecting the country. This works quite nicely in the backend, but I do have a few problems with the frontend where I would appreciate some help.

    I have an overview page which lists all the events using the Catalog list module. Here is a shortened extract of one entry in the $this->entries array that I get on the list template:
    Code:
    'array (
      'id' => '4',
      'catalog_name' => 'Events',
      'parentJumpTo' => '20',
      'tablename' => 'cat_event_events',
      'showLink' => true,
      'class' => ' first even',
      'link' => 'View the item details',
      'url' => 'event-detail/items/larry-carlton-trio-usa/',
      'data' => 
      array (
        'title' => 
        array (
          //...
        ),
        'venue' => 
        array (
          'label' => 'Venue',
          'type' => 'select',
          'raw' => '9',
          'value' => 'Rockhal',
          'ref' => 
          array (
            1 => 
            array (
              'address_country' => '4',
              'is_active' => '1',
              'url_alias' => 'rockhal',
              'parentJumpTo' => '18',
              'parentLink' => 'View the item details',
              'parentUrl' => 'event-detail/items/rockhal/',
            ),
          ),
        ),
    Problem 1:
    On this page there should be a link to the details of each event and a link to the details of the location for each event.
    Unfortunately the link (key parentUrl from the ref array) for the location uses the wrong page - as you can see in the code above it uses the same page (event-detail) as the details page for the event.

    On the event detail page (using catalog reader) the link to the location detail page is fine. Is there any way to get the correct link into the catalog list result array as well?


    Problem 2:
    On the overview page the country should be visible as well. But as you can see in the code above I only get the id of the country in the events list (field address_country). Is there any way to get the name of the country into the result?

    I use contao 2.9.5 and catalog 2.0.0 beta2 24.

    Thanks for any help

    Claudia

  2. #2

    Default Re: data from multiple catalogs in one listing

    i have the same pb as your 2nd one, i only have id.
    if someone could help, it would be nice

  3. #3
    User
    Join Date
    07-01-09.
    Posts
    91

    Default Re: data from multiple catalogs in one listing

    Hi, I will take a stab at this. You are correct, in that if you simply reference the select field, it will return only the ID of the referenced item.

    The scenario if I understand correctly is: We are currently using a listing module for the Events Catalog, I want to also display information for related venues as well as a link to the venue reader. Since a related module will not work with a lister, we do something like this in our Event Lister template:
    Code:
     <?php foreach ($entry['data']['event_venue']['ref'] as $value): ?>
              <?php echo $value[venue_name'];?>
              <?php echo $value[venue_address'];?>
               <?php echo $value[venue_otherfield'];?>
      <?php endforeach; ?>
    The main issue after this is how to link it. Because your lister redirect page is presumably going to the Event Reader, any links to the venue will also try and go to the same reader. For example, In the example above, I could insert:
    Code:
    <?php echo $value['parentLink'];?>
    Which would give the correct url alias, but the wrong reader. So the simplest method would be to make the url manually.

    This may not be the best method, but It should work as I have tested it on my own catalogs. It will also work if your using a tag field instead of a select field. In case you needed to have multiple locations for a single event (never know), you could do that.


    Hope this helps.

    -Brian

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •