Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-16 01:08:43

Carlosjoao
New Member
From: Portugal
Registered: 2009-01-15
Posts: 7

rob_ul_section_list modification

Hi all

Im trying to use rob_ul_section_list plugin on my project.
It works fine even with MLP instaled.

What Im trying to do its to apply CSS styles like in the Dolphinnav menu

Dont need to analyse the CSS, the important part its that it must have two (2) css styles per link, thats one for the right image and one for the left image, so the browser can compose a tab or button that changes size with the link size.

code generated by rob_ul_section_list plugin:

<li><a href="http://localhost/pt/articles/"> Articles-pt </a></li>
<li class="rob_now_li"><a class="rob_now_a" href="http://localhost/pt/ddd/"> dddpt </a></li>

with this code I cannot apply CSS properly because I need to use pseudoclasses, and since i need two (left and right image) it becomes impossible, since I dont have the second tag where to apply the style.
See the css code (working) below.

.rob_ul_section_list a:hover{
background-image: url(/styles/over_left.gif);
background-repeat: no-repeat;
background-position: left top;
display: block;
}
.rob_ul_section_list a:hover span{
display:block;
background-image: url(/styles/over_right.gif);
background-repeat: no-repeat;
background-position: right top;
text-decoration: underline;
z-index: 2;
}

noticed the doubled a:hover style?
So this css would work on this code

<li><a href="http://localhost/pt/articles/"> <span>Articles-pt</span> </a></li>
<li class="rob_now_li"><a class="rob_now_a" href="http://localhost/pt/ddd/"> <span>dddpt</span> </a></li>

notice the inclusion of the <span> tag and compare above

Hope you followed me so far. My question is the following:
Can this plugin be modifed to include the <span> tag on the text part of the <a> tag?

with this modification, the menu will have a 3-state button allowing for more effects.
By 3-state I mean: normal, hover and current. Any existing installations will be unaffected since the <span> tag will simply be ignored unless defined in the CSS.

just for reference my txp tag is:
<txp:rob_ul_section_list include_default="1" li_active_class="rob_now_li" a_active_class="rob_now_a"/>

That said must had that I don’t have any PHP programming skill, so hopefully someone will think this suggestions has some value and writes the code.

Thanks for reading
Carlos

Offline

#2 2009-01-16 01:42:16

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: rob_ul_section_list modification

All you want to do is add <span> tags? Were I wanting to try this, I’d start with this bit:

 $a = tag($title, 'a',

replacing $title with

'<span>' . $title . '</span>'

and similarly with this bit

$a = tag($default_title, 'a', 

and see how that works.

To edit a plugin, click the Edit link (surprise!)


Code is topiary

Offline

#3 2009-01-16 01:46:16

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: rob_ul_section_list modification

Alternately, and perhaps a bit more elegantly, you could use the tag function, for example replacing

$title

with

tag($title, 'span')

Last edited by jsoo (2009-01-16 01:46:39)


Code is topiary

Offline

#4 2009-01-16 02:21:01

Carlosjoao
New Member
From: Portugal
Registered: 2009-01-15
Posts: 7

Re: rob_ul_section_list modification

thanks a lot, the php now does exactly what I needed!!!
just some minor tweaks on the css after a good night sleep and on I go to my next problem :)
Kudos Jsoo

If anyone else reading this wants some clarification about the <span> tag or the css just ask. I will glady post the css.
no online examples just yet though (still on local server)

Offline

Board footer

Powered by FluxBB