Very odd issue/bug where entires within categories cannot be found, until a category_url is changed
Hi all,
I am employing lowseg2cat to show a list of entries based on segment category id.
As follows:
{exp:channel:entries channel="products" category="{segment_2_category_id}" status="not closed" sort="asc" orderby="title" limit="1" }
However, it has happened to me on several sites, where i use this technique, that a category will show no entries. Until i change the category url, and it works again. If i change it back to the original URL, no entries.
Can someone help, it is driving me bonkers.
Thanks,
Ian
Replies
Low 20 Nov 2012 23:00
Try adding dynamic="no"
ianryde 20 Nov 2012 23:34
Hi, nope that fails too. Really, really strange...
ianryde 20 Nov 2012 23:36
For an example of this - a dev site:
http://www.lifts-uk.co.uk/lift-tables...
If i remove the "new" on the category url...
It brings up no entries in that category.
Ian
Low 20 Nov 2012 23:38
Got any categories with the same category url title in other groups?
ianryde 20 Nov 2012 23:42
No, nothing.
ianryde 20 Nov 2012 23:43
It's happened on another site too, exactly the same issue, but I just live with it.
Low 20 Nov 2012 23:52
The way I see it, dynamic="no" should always be added. When the entries tag returns nothing, is the {segment_2_category_id} being parsed correctly? You can check by looking at the template debugger. And what happens if you hard code the category id? Same issue?
ianryde 21 Nov 2012 00:03
It seems to work fine in most cases. It just seems like something happens to the category in some way, and from then on, that particular category URL is null and void.
It is just so weird that it only fails to work on some url and category names.
If i change the url...it works.
I can send you the login if you like to test this...?
Low 21 Nov 2012 00:07
I'll take a look tomorrow. It's past 1 am here at te moment. :)
ianryde 21 Nov 2012 13:11
Thanks for you help with this, so far. Did you manage to find what the issue is?
Many thanks again Low.
Ian
Low 21 Nov 2012 13:50
In your _site_includes/category-products-list template, where I think the issue for you is, there are multiple channel:entries tags.
The first one I encountered is:
Check the dynamic parameter -- you're missing a double quote there.
The second one is:
Here, there isn't a dynamic="no" parameter, which should be there. Otherwise, EE will look in the URL for an entry_url_title, and use that in combination with the other params. This can result to empty tags.
All the {segment_x_category_y} tags are being parsed correctly, as I could see in the Template Debugger.
I'm leaving it up to you to change the templates, as I could see some of those are being saved as files. I don't want to overwrite something there.