Tag and context

Good afternoon,

I have a newbie question, I’m trying to have a menu that is created
dynamically with r:children but whose context will always start at a
certain level (like /products). And go down from there no matter how
deep below in the hierarchy I am.

What would be the best way to achieve this and still use a mechanism
like if_url regex matches to detect the current url and evaluate it to
highlight the active link or category traversed.

Thank you
Christian

Christian B. wrote:

Good afternoon,

I have a newbie question, I’m trying to have a menu that is created dynamically with r:children but whose context will always start at a certain level (like /products). And go down from there no matter how deep below in the hierarchy I am.

What would be the best way to achieve this and still use a mechanism like if_url regex matches to detect the current url and evaluate it to highlight the active link or category traversed.

Thank you
Christian

I think it may help you to see how the sitemap is created:
http://dev.radiantcms.org/radiant/wiki/HowToMakeASiteMap

Cheers,
Mohit.
10/3/2007 | 2:13 AM.

Christian B. wrote:

Good afternoon,

I have a newbie question, I’m trying to have a menu that is created dynamically with r:children but whose context will always start at a certain level (like /products). And go down from there no matter how deep below in the hierarchy I am.

What would be the best way to achieve this and still use a mechanism like if_url regex matches to detect the current url and evaluate it to highlight the active link or category traversed.

Thank you
Christian

Ignore my other post - I misunderstood your question :-S
Must be the time!

Cheers,
Mohit.
10/3/2007 | 2:14 AM.

On 10/1/07, Christian B. [email protected] wrote:

Good afternoon,

I have a newbie question, I’m trying to have a menu that is created dynamically with r:children but whose context will always start at a certain level (like /products). And go down from there no matter how deep below in the hierarchy I am.

What would be the best way to achieve this and still use a mechanism like if_url regex matches to detect the current url and evaluate it to highlight the active link or category traversed.

Thank you
Christian

Hi Christian,

Did you ever get an answer to your question? I too have been looking
for this and there are a couple of options that I’m wanting to try out
but haven’t yet.

a) Using the backdoor extension (http://backdoor.rubyforge.org/) in
combination with some regex matching on the current url. Not ideal if
you’re worried about executing Ruby inside your templates.

or

b) There’s also the if_ancestor_or_self tag in the navigation
extension that might do it. Seems you could use that tag to set a CSS
class for the active link/menu.

http://svn.artofmission.com/svn/plugins/radiant/extensions/navigation_tags/lib/navigation_tags.rb

Victor


Victor Cosby
Independent Software Consultant and Web D.
LFL Communications

Hi Victor,

Yes I figured something out to make it work for me with as little
hardcoded encoding as possible

Basically I use <r:find url=“/products” >

Then within that I iterate through all children and within each
iteration I iterate through the second level.

I use the navigation extension you describe to change the css class
as necessary (modified that extension, added the unless_ for
if_ancestor and unless_self

The result so far: www2.warmlyyours.com

Christian

On Oct 5, 2007, at 5:11 PM, Victor Cosby wrote:

evaluate it to highlight the active link or category traversed.
a) Using the backdoor extension (http://backdoor.rubyforge.org/) in
navigation_tags/lib/navigation_tags.rb
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant

Christian B.
Chief Information Officer
IT Department

Phone: (800) 875-5285 Ext. 800

Fax: (800) 408-1100

Email: [email protected]


WarmlyYours

Honeywell authorized licensee

2 Corporate Dr., Suite 100
Lake Zurich, Illinois 60047

Visit the WarmlyYours website at: www.warmlyyours.com

24/7 Installation Support • Lifetime Technical Assistance • Free
Design Service

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to which they
are addressed. If you have received this email in error please notify
the system manager. Please note that any views or opinions presented
in this email are solely those of the author and do not necessarily
represent those of the company.