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

lugin / fixed_order issues...

Development and Programming

Paul Cripps (Nine Four)'s avatar
Paul Cripps (Nine Four)
104 posts
16 years ago
Paul Cripps (Nine Four)'s avatar Paul Cripps (Nine Four)

We have built a plugin that records the items you recently viewed. This works in conjunction with the normal entries tags:

{exp:weblog:entries weblog="myweblog" parse="inward" limit="4" fixed_order="{exp:recentlyviewed:get_entries weblog='properties' distinct='off'}"}

an then use fixed_order and the plugin to set the required entry_ids

This works a treat then but the issue we have it, sometime we may want to display the actual list, so returning multiple entries.

eg the list of IDs may be 1,3,5,4,3,2,1,4 as you can see there are repeats but these are not shown. the rendered list is as follows: 1,3,5,4,2

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
16 years ago
Lisa Wess's avatar Lisa Wess

Paul,

If you hard-code the output instead of calling the plugin, I’m betting that it doesn’t output the same entry twice, is that correct? I do not believe this is a plugin issue, specifically, but that the weblog entries tag won’t call an entry more than once in one loop.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Pretty sure Lisa is absolutely spot on with this one (she always is actually 😉 ) as when I was making my Shopping Cart Plugin I had the opposite in that I didn’t want the same entry to show more than once so I went about coding the duplicates out but very early on in the testing found out that the weblog entries tag won’t actually output the same entry twice so that will definitely be the issue here.

       
Paul Cripps (Nine Four)'s avatar
Paul Cripps (Nine Four)
104 posts
about 16 years ago
Paul Cripps (Nine Four)'s avatar Paul Cripps (Nine Four)

You are both correct.

To be honest in most instances we wouldn’t want duplicates, we were wondering if it was possible using the weblog entries tag.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 16 years ago
Mark Bowen's avatar Mark Bowen

If you mean is it possible to feed in entry_ids to a weblog tag with a plugin then yes this is definitely possible.

The way I do it with my plugins when I need to do that sort of thing is to use a plugin tag pair and then do this sort of thing :

{exp:my_plugin_name weblog="default_site" parse="inward"}

{exp:weblog:entries weblog="default_site" entry_id="{entries}" dynamic="off"}
<h2>{title}</h2>
{/exp:weblog:entries}

{/exp:my_plugin_name}

This way I get the entry_ids sent into the weblog entries tag which I’m guessing is what you need here.

Hope that helps a bit.

Best wishes,

Mark

       

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.