Results 1 to 7 of 7

Thread: Can list and reader have default value?

  1. #1
    User
    Join Date
    04-05-10.
    Location
    Ukraine, Kiev
    Posts
    47

    Default Can list and reader have default value?

    I have a page: /profiles-and-colors.html
    There are a list and a reader.
    When I go to this page, filter is not active and reader says «Catalog Item not Found»
    Not pretty

    Is there some possibility to make list and reader show some default item? For example, first or second from the list of items in the list?
    I've tried something with comparing $_SERVER['REQUEST_URI'] with $entry['url'], but with this I can do nothing, but styling, depending on is this page of active list item or not.

    Thank you
    I forge my wisdom
    Into an arc surrounding all.
    I forge my heartbeat
    To a dome all heavens wide

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Can filter and reader have default value?

    The filter and list was designed together, not the reader and filter.

  3. #3
    User
    Join Date
    04-05-10.
    Location
    Ukraine, Kiev
    Posts
    47

    Default Re: Can filter and reader have default value?

    Sorry, I wath talking about list and reader
    I forge my wisdom
    Into an arc surrounding all.
    I forge my heartbeat
    To a dome all heavens wide

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Can list and reader have default value?

    Well the list and readers are not design to appear on the same page. Just like the News system:

    List/Filter page => Reader Page

    So you can see the list shows a list of items and the filter filters that further.

    You can do several things to make default items (pointed out in the tutorials forums pages)
    • The list will by default always show all items[/*:m:ia37ck0l]
    • If you need to auto-filter the list by a default value (only hardware items), then add a manual condition[/*:m:ia37ck0l]
    • If you have used PAGES as your categories, then you can add {{env:age_id}} as your condition, and the current page will be used as an auto-filter, so you can use 1 list module on all the category pages (if you want to do it this way)[/*:m:ia37ck0l]


    The reader is usually not a visible page, so it's hidden from navigation. The only way to reach the page would be by clicking on an item in the list view's "view details" link.

  5. #5
    User
    Join Date
    04-05-10.
    Location
    Ukraine, Kiev
    Posts
    47

    Default Re: Can list and reader have default value?

    Yes, this are common options... but due to design, I need to place list and reader on one page. And this works good. I've even made "active" position of the list highlight, like this:

    Code:
    $cur_addr = $_SERVER['REQUEST_URI'];
    <?php if ('/'.$entry['url'] == $cur_addr): ?>
    
    <li class="active">">[img]<?php echo $entry['data']['sq_photo']['raw']; ?>[/img]
    
    <?php else: ?>
    [*]">[img]<?php echo $entry['data']['sq_photo']['meta'][0]['src']; ?>[/img]
    
    <?php endif; ?>
    List shows all items (as images), the current item is highlighted — everything works.
    There is no problem to make default active item in catalog list.

    But the last problem is to make catalog reader to show default item, if nothing is passed to it.
    Is there possibility to pass some options to reader module?
    I forge my wisdom
    Into an arc surrounding all.
    I forge my heartbeat
    To a dome all heavens wide

  6. #6
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Can list and reader have default value?

    Nope. You can simply write some code or use a redirect if a default is not found, e.g.

    Code:
    if (!strlen($this->Input('items'))) { $this->redirect('readerpage/items/defaultitem.html'); }
    PS. The Navigation Module is supposed to do what you want with items visible (but it does it for categories).

  7. #7
    User
    Join Date
    04-05-10.
    Location
    Ukraine, Kiev
    Posts
    47

    Default Re: Can list and reader have default value?

    $this->redirect!
    so easy!
    yes!
    I love you, Thyon! ))
    I've tried to make a redirect, but with php header it isn't possible and this thing I didn't find anywhere.
    You've saved my life ))
    I forge my wisdom
    Into an arc surrounding all.
    I forge my heartbeat
    To a dome all heavens wide

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
  •