I also get an error when i dont use a category:
{exp:entries_list weblog="myweblog" entry_id="{segment_3}"}
Next entry id is:{next_entry_id}
Previous entry id is:{previous_entry_id}
{/exp:entries_list}
Throws:
Notice: Undefined index: cat_name in /var/sites/test/system/plugins/pi.entries_list.php on line 1113 Notice: Undefined index: cat_url_title in /var/sites/test/system/plugins/pi.entries_list.php on line 1114
Is my code above the correct way to display next and previous links?
Hi Bohboh,
In terms of the notices, they are not mission-critical show stoppers… In fact, I think only super admins will see those notices when they are logged in.
If you want a quick way to remove those notices, just put an @ in front of the lines that are throwing-up notices… See message #26.
Other than the notices, are you getting next_entry_id and previous_entry_id to display?
Hi Laisvunas! Thanks for testing, I really appreciate it.
Hrm, you know what… I wonder if it has to do with the PHP version.
I just realized that my host is running PHP4, not v5.
<off-topic>Kinda disappointed, because they say that all their servers run on PHP5.</off-topic>
I could send you server-setup specifics if you are curious?
Hi Laisvunas,
Can I use this in place of Category Archives? I just want to extract the total results of the entry_titles variable pair so I can add a closing ul. this replicates the functionality -
{exp:weblog:category_archive weblog="events" show_future_entries="yes" status="not Closed" style="linear"}
{categories}
<h5>{category_name}</h5>
<ul>
{/categories}
{entry_titles}
<li><a href="http://{path=">{title}</a></li>
{if entry_titles_total_results}
</ul>
{/if}
{/entry_titles}
{/exp:weblog:category_archive}
Hi Steve,
Try this code:
{exp:entries_list weblog="events" sort_separately="categories"}
{if entries_list_separate_count == 1}
{if entries_list_category_count > 1}
</ul>
{/if}
<h5>{entries_list_category_name}</h5>
<ul>
{/if}
<li><a href="http://">{entries_list_title}</a></li>
{if entries_list_category_count == entries_list_category_count_total}
</ul>
{/if}
{/exp:entries_list}
Nearly there except I only get one category header and entries from all categories listed.
Here is my code -
{exp:entries_list weblog="events" sort_separately="categories"}
{if entries_list_separate_count == 1}
<h5>{entries_list_category_name}</h5>
<ul>
{/if}
<li><a href="http://">{entries_list_title}</a></li>
{if entries_list_separate_count == entries_list_total_results}
</ul>
{/if}
{/exp:entries_list}
Hi Steve,
your code lacks one parameter - “category”. The value of this parameter should be a list of pipe separated category ids:
{exp:entries_list weblog="events" category="9|11|15|23|56" sort_separately="categories"}
{if entries_list_separate_count == 1}
<h5>{entries_list_category_name}</h5>
<ul>
{/if}
<li><a href="http://">{entries_list_title}</a></li>
{if entries_list_separate_count == entries_list_total_results}
</ul>
{/if}
{/exp:entries_list}
No, you can’t. The parameter “sort_separately” works together with parameter “category” in the following way: if “sort_separately” has the value “categories”, then entries are displayed category by category as was specified in the parameter “category”. E.g. if we have
category="9|11|15|23|56"
then at first will be listed entries posted into category 9, then those which are posted into category 11, then those which are posted into category 15 etc.
If you need to supply the value of the parameter “category” dynamically, then you should use some other add-on. There is plugin which might help to aggregate all category ids into pipe delimited string - Value Aggregator. But as much as I know there is no plugin which would take as an input category group id and would return all category ids.
Is there no way to limit by status?I could really use the status parameter:
{exp:entries_list weblog="{embed:weblog}" site="1" per_page="1" status="open|somethingelse"}
Without it, all the work I did over the last day is more or less useless :-)
I’m trying to get results in my pagination similar to “Viewing 1-10 of 30, Viewing 11-20 of 20”, etc. I’m almost there with this plugin and a bit of PHP, but like I said - without a status parameter the counts are not accurate at all. Even if there were a simple hack to select only “Open” items. It looks like even if I set some items to “closed”, that my {entries_list_total_results} is the same as if all the entries were open.
Thanks for your quick update. I was able to get what I needed working with another plugin (Entries Count) to get the total results returned, and then some PHP to look at the segement where the pagination takes place - I then do a little math there to get the 1st count number and the last count number of the entries you are currently viewing (like “viewing 21-26 of 26”).
Though I do think adding status to this make it that much more useful…thank you.
There seem to be a few typos in this plugin…unless you mean to do that for some reason. For example ‘{enties_list_current_page}’ should be ‘{ENTRIES_list_current_page}’, no? (Missing an ‘r’). They are this way in the plugin code, but it could be confusing to someone who thinks they are typos in the docs, and tries to correct them (like I did…) which leads to broken output. Here are the other variables:
{enties_list_total_pages}
{enties_list_current_page}
{enties_list_pagination_links}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.