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
Re: Can filter and reader have default value?
The filter and list was designed together, not the reader and filter.
Re: Can filter and reader have default value?
Sorry, I wath talking about list and reader
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::page_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.
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:
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?
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).
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 ))