This is a great solution. It would be worth writing up as a plugin.

My only comment is that I'm pretty sure toolmapping does now work with
markup rules, so you would would need to follow the second option.

This is such a good idea, I wonder if it isn't worth putting some kind
of option in the core to do this? Perhaps simply putting active in the
third part of the link

[[page|Label|active]]

and then BoltWire would know to check if the page was the current one
and if so to add the appropriate class.... Just a thought...

Cheers
Dan


On Tue, Feb 15, 2011 at 9:19 AM, DrunkenMonk <[email protected]> wrote:
> I think you might want to handle the png in the css file, and simply
> add class=active to the link itself.
>
> Making the link act like you are hovering over it is simply a matter
> of setting the #active entry to the same the on hover entry.
>
> Having a bunch of if statements in all your links is a lot of writing,
> and will make your source files cluttered. I would simply extend or
> replace the link markup function to always include this behavior
> (adding class=active on the correct links) as I cannot think of a case
> where the behavior is bad.
>
> I'm not sure how the toolmap thing works for links, but either
> $BOLTtoolmap['m']['links'] = 'mylinks';
>
> or
> MarkUp('links', 'links', '/\[\[(.*?)\]\]/e',
> "BOLTMmylinks('$1')");  // [[ ]] // I think thats how you replace
> links, otherwise you
> may want to change the markup to something, like << >>. Dan will
> correct me.
>
> to your config.php should let you use your own markup function.
> then add something like the following function:
>
> function BOLTMmylinks($line) {
>    global $pageShow;
>    list($link, $label, $attrs) = explode('|', $line, 3);
>
>    if( $pageShow == $link ) $attrs .= ' class=active';
>    return BOLTMlinks( implode(array($link, $label, $attrs)) );
> }
>
> which lets you re-use the BOLTMlinks code with the added
> functionality.
> keep in mind that I have not tested this, i just wrote it directly
> into the reply.
>
> you would then want something like the following in your code.style or
> css file:
>
> a#active {color: &#36;&#36;accent_color;}
>
> which I took from side a:hover in code.style. If you want your active
> code to always mirror your hover, you can just add it do the same
> post...
>
>
> On 14 Feb, 10:00, Kevin <[email protected]> wrote:
>> Been thinking about this for a while...
>>
>> I've been wanting a way to highlight a menu item so that when you are on
>> that page, the menu item on the menu is marked or highlighted indicating
>> that is the page you are on.
>>
>> I came up with one way, which is not exactly what I really want, but getting
>> in that direction by using if statements in the menu selections like:
>>
>> * [[main|Home [if equal {wv-requri} '/main'][^active.png
>> class=activemenu^][if][if equal {wv-requri} '/'][^active.png
>> class=activemenu^][if]]]
>> * [[about|About Us [if equal {wv-requri} '/about'][^active.png
>> class=activemenu^][if]]]
>> * [[contact|Contact Us [if equal {wv-requri} '/contact'][^active.png
>> class=activemenu^][if]]]
>> * [[project|Project List [if equal {wv-requri} '/project'][^active.png
>> class=activemenu^][if]]]
>>
>> {wv-requri} is a value that my Web Visitor plugin provides.  It contains the
>> URI for the page you are currently on.
>>
>> So the IF statement checks to see if the page you are on maches the menu
>> item and (now) places a triangle next to it indicating you are on that page.
>>
>> Ideally, I would want the button background in this case to be the same as
>> like when you are hovering over it with a mouse.
>>
>> Not quite there yet.  The home or main button needs two checks in case you
>> land on the page without selecting the home page.
>>
>> Example page...  http://www.maelight.com
>
> --
> You received this message because you are subscribed to the Google Groups 
> "BoltWire" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/boltwire?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en.

Reply via email to