11
rewwer
Re: URGENT - Problem with marking(highlighting) "current link" - How to mark it correctly?
  • 2008/12/16 0:14

  • rewwer

  • Just popping in

  • Posts: 24

  • Since: 2007/10/2


I`v found smth like what i`v looking for, but ones again - damn(sorry), i could not get it working properly on XOOPS theme, how to implement it in theme - link in studio the JS script can be downloaded at end of the page...

12
Burning
Re: URGENT - Problem with marking(highlighting) "current link" - How to mark it correctly?
  • 2008/12/16 8:36

  • Burning

  • Theme Designer

  • Posts: 1163

  • Since: 2006/8/22


hi,

Keep <div id="<{$xoops_dirname}>"> ... </div>

And try this :

1. Edit your style.css and replace : #mainmenu by .mainmenu

2. Edit your block template : modules/system/templates/blocks/system_block_mainmenu.html.
Replace :
le="color: #000000"><?php <td id="mainmenu">

By :
le="color: #000000"><?php <td class="mainmenu">



3. Add in style.css this new code
le="color: #000000"><?php #system .mainmenu a {color: red;} #news .mainmenu a {color: red;} #mylinks .mainmenu a {color: red;} #oledrion .mainmenu a {color: red;} #... .mainmenu a {color: red;}

(#your-module-folder-name)


Hope it works
Still learning CSS and... english

13
rewwer
Re: URGENT - Problem with marking(highlighting) "current link" - How to mark it correctly?
  • 2008/12/16 23:58

  • rewwer

  • Just popping in

  • Posts: 24

  • Since: 2007/10/2


2Burning... replacing id by class that you described not working to... I don't know what to do...
Resized Image

14
rewwer
Re: URGENT - Problem with marking(highlighting) "current link" - How to mark it correctly?
  • 2008/12/25 23:23

  • rewwer

  • Just popping in

  • Posts: 24

  • Since: 2007/10/2


And ones again ! Good day comrades! Mostly Iv found the Decision of that problem! Its the java+CSS... but once again - damn(sorry)! it works not such perfectly as I expects! it highlights the current link when you browsing entire site, but when you opening the home page or some modules that script highlights entire the whole menu... here it is - water.info.tm (all content on Russian)
here is the code of JS (inserts before the HEAD tags closes </head>)
le="color: #000000"><?php <!-- highlight script--> <SCRIPT LANGUAGE="JavaScript"> <!-- function highlightLink() { //Get filename from the URL thisPage = document.URL.substring(document.URL.lastIndexOf("/")+1 ,document.URL.length); //Loop through all the links for (i=0; i<document.links.length; i++ ) { //Get only the filename from the href of navigation link pageLink = document.links[i].href.substring(document.links[i].href.lastIndexOf("/")+1 ,document.links[i].href.length); //if the current filename & the link-ed file name are the same, change the background color of that link if (thisPage == pageLink) { //BG is the name of a class that I have defined, that sets background color to grey document.links[i].className = "BG"; } } } //--> </SCRIPT> <!-- highlight script-->


here is a part of CSS

le="color: #000000"><?php /* highlight styles */ .BG {color: red; font:bolder, larger, ;} /* Highlight styles */

15
rewwer
Re: URGENT - Problem with marking(highlighting) "current link" - How to mark it correctly?
  • 2008/12/29 11:07

  • rewwer

  • Just popping in

  • Posts: 24

  • Since: 2007/10/2


IS ENY BODY HERE!?
It was soo close, but now its too far...
and I had to use Trabis decison...

16
rewwer
Re: URGENT - Problem with marking(highlighting) "current link" - How to mark it correctly?
  • 2009/1/8 16:09

  • rewwer

  • Just popping in

  • Posts: 24

  • Since: 2007/10/2


Goood day comrades XOOPERS!
All done! all was so damn(sorry) simple as it could be!
Look at at my previous post... and find the correction...
here is a correct variant of script -
le="color: #000000"><?php <!-- highlight script--> <SCRIPT LANGUAGE="JavaScript"> <!-- function highlightLink() { //Get filename from the URL thisPage = document.URL.substring(document.URL.lastIndexOf("%")+1 ,document.URL.length); //Loop through all the links for (i=0; i<document.links.length; i++ ) { //Get only the filename from the href of navigation link pageLink = document.links[i].href.substring(document.links[i].href.lastIndexOf("%")+1 ,document.links[i].href.length); //if the current filename & the link-ed file name are the same, change the background color of that link if (thisPage == pageLink) { //BG is the name of a class that I have defined, that sets background color to grey document.links[i].className = "BG"; } } } //--> </SCRIPT> <!-- highlight script--> </head> <body id="<{$xoops_dirname}>" class="<{$xoops_langcode}>" onload="highlightLink()">

insert it as is in your theme and add to your CSS

le="color: #000000"><?php /* highlight styles */ .BG {color: #FF0000;} /* Highlight styles */

the decision was so close as i said...
and here is the key - just looked at the JS closely and changed
le="color: #000000"><?php href.lastIndexOf("/")+1
to
le="color: #000000"><?php href.lastIndexOf("%")+1


the result could be seen here http://water.info.tm

thanks to every one for your replies and suggestions...
________________________________________
with best regards and wishes Happy hollydays xoopers...

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits