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: Pages Menu

Development and Programming

Eric Barstad's avatar
Eric Barstad
198 posts
17 years ago
Eric Barstad's avatar Eric Barstad

This is a great little plug-in. The {current_page} variable isn’t working for my home page, though. My home page is set up through the pages module with a uri of “/”. {current_page} is working on other pages, just not home. Any ideas?

       
Cocoaholic's avatar
Cocoaholic
445 posts
17 years ago
Cocoaholic's avatar Cocoaholic
My home page is set up through the pages module with a uri of “/”.

Nice, I didn’t know that worked… I changed the plugin to work with just the “/”.

This version (1.2.2) also adds “entry_id” as a parameter.

{exp:pages_menu entry_id="1|3|5|7"}
<a href="http://{url}">{title}</a>

{/exp:pages_menu}

You can also exclude entry_id’s using “not”.

{exp:pages_menu entry_id="not 2|4|6"}
<a href="http://{url}">{title}</a>

{/exp:pages_menu}

download link

       
Eric Barstad's avatar
Eric Barstad
198 posts
17 years ago
Eric Barstad's avatar Eric Barstad

Sweet! I was going to request the entry_id parameter (for those times when you want to exclude the home page). This is awesome.

       
Kippi's avatar
Kippi
83 posts
17 years ago
Kippi's avatar Kippi

HI, I have the plugin up and working sweet.

Just one question.

I have a menu list all linking to static “pages”. I want to dynamically include just one menu item that links to another actual “weblog” and not a static page.

Is this possible with the way “pages” are set up?

       
Cocoaholic's avatar
Cocoaholic
445 posts
17 years ago
Cocoaholic's avatar Cocoaholic

Using conditionals you could easily include an extra menu item.

Something like this using the count variable:

{exp:pages_menu}
<a href="http://{url}">{title}</a>

{if count == 4}
<a href="/whatever/url/">Your Page</a>

{/if}
{/exp:pages_menu}
       
Kippi's avatar
Kippi
83 posts
17 years ago
Kippi's avatar Kippi

Hi, Thanks:-)

Sorry to be a nonce but how do you use the count coditional?

       
Kippi's avatar
Kippi
83 posts
17 years ago
Kippi's avatar Kippi

Hi again, Sorry, I posted a reply because I thought I figured it out but no joy.

Any pointers

Thanks for your help. 😉

Paul

       
Kippi's avatar
Kippi
83 posts
17 years ago
Kippi's avatar Kippi

Hi, got it working.

Can you order_by “custom field”

       
Cocoaholic's avatar
Cocoaholic
445 posts
17 years ago
Cocoaholic's avatar Cocoaholic

No.

If you need that functionality you should build your menu using the weblog tag. (see my original post)

       
1 2

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.