We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: Entries List

Development and Programming

Billy Patel's avatar
Billy Patel
284 posts
16 years ago
Billy Patel's avatar Billy Patel

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?

       
mhulse's avatar
mhulse
329 posts
16 years ago
mhulse's avatar mhulse

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?

       
Laisvunas's avatar
Laisvunas
879 posts
about 16 years ago
Laisvunas's avatar Laisvunas

Hi mhulse and Bohboh,

I played with code snippets you posted but was not able to reproduce any unwanted effects.

       
mhulse's avatar
mhulse
329 posts
about 16 years ago
mhulse's avatar mhulse

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?

       
stinhambo's avatar
stinhambo
1,268 posts
about 16 years ago
stinhambo's avatar stinhambo

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}
       
Laisvunas's avatar
Laisvunas
879 posts
about 16 years ago
Laisvunas's avatar Laisvunas

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}
       
stinhambo's avatar
stinhambo
1,268 posts
about 16 years ago
stinhambo's avatar stinhambo

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}
       
Laisvunas's avatar
Laisvunas
879 posts
about 16 years ago
Laisvunas's avatar Laisvunas

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}
       
stinhambo's avatar
stinhambo
1,268 posts
about 16 years ago
stinhambo's avatar stinhambo

Ah! I assume I can specify a category group here? This would mean automatic lists if the user adds categories down the road.

       
Laisvunas's avatar
Laisvunas
879 posts
about 16 years ago
Laisvunas's avatar Laisvunas

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.

       
Laisvunas's avatar
Laisvunas
879 posts
about 16 years ago
Laisvunas's avatar Laisvunas

Hi,

I released version 2.8.2 of Entries List.

In this release a couple of minor bugs were fixed.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
about 16 years ago
Ryan M.'s avatar Ryan M.

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.

       
Laisvunas's avatar
Laisvunas
879 posts
about 16 years ago
Laisvunas's avatar Laisvunas

Hi Ryan,

Grab the version 2.9 - I added “status” parameter (supports pipe and “not” operators) and {entries_list_status} variable.

And, of course, don’t forget to add a Fav for this plugin in devot-ee.com 😊

       
Ryan M.'s avatar
Ryan M.
1,511 posts
about 16 years ago
Ryan M.'s avatar Ryan M.

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.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
about 16 years ago
Ryan M.'s avatar Ryan M.

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}
       
1 2 3 4 5 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.