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

Tome- Current page still being linked to in the navigation

Development and Programming

One Of Us's avatar
One Of Us
15 posts
17 years ago
One Of Us's avatar One Of Us

Hi,

I’m using Mark Huot’s Tome module and I’m currently building up the navigation for my site using the following code:

{if seg_1 == "writing_tips"}
{exp:static_page_path direction="post" page="6"}<a href="http://{url_title}" title="Click to visit the {title} page.">{title}</a>{/exp:static_page_path}
{/if}
{if seg_1 == "features"}
{exp:static_page_path direction="post" page="7"}<a href="http://{url_title}" title="Click to visit the {title} page.">{title}</a>{/exp:static_page_path} 
{/if}
{if seg_1 == "articles"}
{exp:static_page_path direction="post" page="8"}<a href="http://{url_title}" title="Click to visit the {title} page.">{title}</a>{/exp:static_page_path} 
{/if}
{if seg_1 == "writing_resources"}
{exp:static_page_path direction="post" page="15"}<a href="http://{url_title}" title="Click to visit the {title} page.">{title}</a>{/exp:static_page_path} 
{/if}
{if seg_1 == "news"}
{exp:static_page_path direction="post" page="14"}<a href="http://{url_title}" title="Click to visit the {title} page.">{title}</a>{/exp:static_page_path} 
{/if}

The “if” statements basically render a different set of navigation links for each of the sections on my website. (You can see my website at http://www.oneofus.co.uk - the above code build the left hand menu.)

What I’m trying to do is to make it so that the current page in the left hand menu isn’t being displayed as a link - i.e. remove the “a” tag and just show the title.

Any ideas on how I would do this?

Edited the title so it was clear it was Tome related- r

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
17 years ago
Robin Sowell's avatar Robin Sowell

I don’t think I’m fully spotting where this code is in use- and I’m not familiar with Tome, so I’m not entirely sure what the code should do.

That said- I’d just remove the a href- and it wouldn’t be a link.

I fear that’s the wrong answer, as exp:static_page_path may be generating more than one link. In which case- want me to shift this down to the third party modules forum? I suspect this is more a question of how Tome works than an EE tag/conditional issue.

       
One Of Us's avatar
One Of Us
15 posts
17 years ago
One Of Us's avatar One Of Us

Hi,

Of course, yes this is more to do with Tome, not EE tags.

The code above does indeed output links to all pages that sit under “page=6” so removing the href would remove it for all links. I did try and add an “if” statement in to try and check if segment 2 matched the url_title and if so, not display the href but it applied it to all links again.

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
17 years ago
Robin Sowell's avatar Robin Sowell

Heh- yes, I feared it was not going to be such a simple fix. Good idea on the seg 2 check- I’m not sure why it wouldn’t work. But in truth, I’m not at all up on this module and don’t have it installed for testing. Let me shift this down to the modules forum where those more up on it can chime in. Mark keeps a good eye out for questions. (Might post to the main Tome thread if this doesn’t help.)

Sound good?

       
One Of Us's avatar
One Of Us
15 posts
17 years ago
One Of Us's avatar One Of Us

My guess is that the exp:static_page_path (which does indeed generate more than one link) is looping through each page it finds and generates the link and therefore can only apply the if statement to the loop as a whole and not apply it during the loop (if that makes sense - I’m not a programmer just a mark-up/design guy).

I’ll get this posted in the Tome thread too but my fall-back plan is to simply leave the links as links but use a technique to style them to strip out the underline and blue link colour. The main aim is to mitigate the fact that a lot of people land on my site directly at one of the articles. The next most popular link from that page is the link to the same page in the left hand navigation. My guess is that because people have directly navigated here from Google they then think that the link in the left leads them to more information about the topic of the page. If I made it look like the current selected page (which removing the link would also do) then it should help people with their way-finding.

       

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.