[Radiant] if_ancestor_or_self returns true for siblings?

1 view
Skip to first unread message

Stuart Henry

unread,
Feb 23, 2010, 12:16:42 AM2/23/10
to rad...@radiantcms.org
Hi all,

I'm new to RadiantCMS, so my apologies if this has been answered
elsewhere...

My basic page structure is something like:

* Home
** Events
*** Calendar
** Membership
*** Join
** Gallery
** Resources

I'm using <r:if_ancestor_or_self>...</r:if_ancestor_or_self> within the
primary navigation list (Events | Membership | Gallery | Resources) to apply
a style to the primary nav items if the current page is a descendent of that
page.

The problem is that if_ancestor_or_self seems to be returning true for
sibling links, so if I'm at /events/calendar all of the navigation links
contain the class that is being applied within the
block <r:if_ancestor_or_self>...</r:if_ancestor_or_self>.

Am I missing something with the use of if_ancestor_or_self? Thanks for any
help,

--
Stu
_______________________________________________
Radiant mailing list
Post: Rad...@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
List Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Radiant: http://radiantcms.org
Extensions: http://ext.radiantcms.org

Leon Miller-Out

unread,
Feb 23, 2010, 10:19:33 AM2/23/10
to rad...@radiantcms.org
I'm not sure about the r:if_ancestor_or_self tag, but an alternative would
be to use

<r:if_url matches="^/parent/">class="active"</r:if_url>

within your menu items. That's what I'm doing.

Leon

=============================
Leon Miller-Out
President & CTO, Singlebrook Technology, Inc
le...@singlebrook.com
p 607-330-1493
f 607-697-0457
119 S. Cayuga St. - Suite 202
Ithaca, NY 14850

Reply all
Reply to author
Forward
0 new messages