Editing the Menu, noob edition

21 views
Skip to first unread message

Marc Luzietti

unread,
Mar 8, 2010, 1:24:03 PM3/8/10
to Refinery CMS
A theme I'm using requires adding a <span> element inside the anchor
element, around the text.

I see in _menu_branch.html.erb the following code: <%= link_to
menu_branch.title, menu_branch.url %>.

If this were a standard application, I'd be spelunking the
controllers, probably menu_controller, to do what I need. But, you've
hidden everything.

Marc Luzietti

Philip Arndt

unread,
Mar 8, 2010, 2:42:53 PM3/8/10
to refine...@googlegroups.com
Can you not just override and change _menu_branch to be:

<span><%= link_to
menu_branch.title, menu_branch.url %></span>

?

Marc Luzietti

unread,
Mar 8, 2010, 4:07:39 PM3/8/10
to Refinery CMS
That wraps the anchor with a <span>. I need the span /inside/ the
anchor, but around the text. It's because IE sux, and doesn't support
hover on any element.

Marc L

Philip Arndt

unread,
Mar 8, 2010, 4:09:42 PM3/8/10
to refine...@googlegroups.com
but hover is supported on anchor tags in all browsers.......

But if you still want to hack it, wouldn't this work:
<%= link_to "<span>#{menu_branch.title}</span>", menu_branch.url %>

Marc Luzietti

unread,
Mar 8, 2010, 4:14:57 PM3/8/10
to Refinery CMS
Yes, but if you want hover on a <span> in order to have two background
images change, the <span> has to be inside an anchor. It's how you
make tabs expand or contract based on the text size.

And that did the trick. I'm new to Ruby, and I forgot how to do that,
but as soon as I saw the code I slapped my head.

Thanks.

Marc L

Reply all
Reply to author
Forward
0 new messages