brandnewbox.co.uk

Home of Andrew Weaver, a uk-based web developer specialised in building high-quality websites

Selected items and ExpressionEngine 1.6.5

Thursday, November 13th, 2008

Andrew Weaver

Category: , ,

Version 1.6.5 of ExpressionEngine introduced a new feature that simplifies the use of my Selected Items module.

With the addition of the fixed_order= parameter to the weblog entries tag in EE 1.6.5, you can now use the Selected Items module with EE’s built-in weblog tag features much more easily.

Prior to version 1.6.5 there was no way to arbitrarily specify the order of entries; entries had to be ordered using the orderby= parameter.

Selected items provided a work-around to this, with the side-effect that some of the standard weblog tag variables (such as {count}) were unavailable and required alternative syntax. 

Before:

<ul>
{exp:selecteditems name="Test"}
{exp
:weblog:entries weblog="default_site" entry_id="{selecteditems_id}" orderby="selecteditems"}
<li class="{selecteditems_switch="one|two|three"}">{selecteditems_count}. <a href="{path=home}{url_title}">{title}</a></li>
{/exp:weblog:entries}
{
/exp:selecteditems}
</ul

The fixed_order parameter makes this part of the Selected Items module unnecessary. You can now use the module’s interface to select and order entries and use the standard weblog tag to display them.

After:

<ul>
{exp:selecteditems name="Test"}
{exp
:weblog:entries weblog="default_site" fixed_order="{selecteditems_id}"}
<li class="{switch="one|two|three"}">{count}. <a href="{path=home}{url_title}">{title}</a></li>
{/exp:weblog:entries}
{
/exp:selecteditems}
</ul

See also

 

Comments

1. Andy Morris
7th Feb 2009 at 10:14 pm

Am I able to use

offset="1" 

in a weblog entries tag when using selected items Module.

2. Andrew Weaver
8th Feb 2009 at 10:24 am

Hi Andy

If you use the second version of the code above, offset should work.

If you are using the first version - if you are running EE 1.6.4 or less - you will have to use {if selecteditems_count > 1}{/if} to miss out the fist item.

Andrew

3. .(JavaScript must be enabled to view this email address)
16th Feb 2009 at 3:23 pm

How do you install Selected Items? I downloaded but there’re no specific instructions included. It would help because I’m new to Expression Engine. Thanks.

4. Andy Morris
18th Feb 2009 at 12:58 am

Jen: you can find Andrew’s Docs here: http://www.brandnewbox.co.uk/docs/

Andrew- in some browsers the control panel shows “loading…” next to the get entries button and that function seems to be frozen. I can’t list other entries. On another system (say my laptop versus my desktop) in the same browser and same version it works fine. Is there a security feature that might be blocking the module somehow? Is there a setting that would cause this to happen?

Thanks for your help with my earlier question. I had not adjusted to the newer parameters since upgrading.

5. .(JavaScript must be enabled to view this email address)
23rd May 2009 at 3:10 am

Andy, I also had a “Loading…” problem. I found out it was because I didn’t have the CP JQuery extension.

Commenting is not available in this weblog entry.

© brandnewbox.co.uk 2004-2010