Announcement

Collapse
No announcement yet.

highlight current page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    highlight current page

    i am using a slightly modified version of actinic generated java script menu:

    <SCRIPT LANGUAGE = JavaScript>
    <!--
    function BulletList(pItem)
    {
    var strIDs = '<div id="menuLeft">';
    strIDs += '<div id="menuLeftA">';
    strIDs += '<ul>';
    {
    for (var i = 1; i <= pItem.length; i++)
    {
    strIDs += '<li><a href=' + pItem[i].sURL + '>'+ pItem[i].sName + '</a></li>';
    }
    }
    strIDs += '</UL>';
    strIDs += '</DIV>';
    strIDs += '</DIV>'
    return strIDs
    }
    -->
    </SCRIPT>

    My question is how do i get actinic v7 business to highlight the current section that the customer is viewing?

    #2
    forget that code.

    can anyone help me with getting my nav menu to highlight the current page. i have checked around using the search function and i know it involves creating new variables, but what i do with them and how i implement this is html code i have no idea.

    can this even be done with v7? i keep seeing block ifs mentioned, can i use those with v7?

    if anyone has a link where this is all explained in one artical it would very much appreciated if they could share said information...

    Comment


      #3
      "Forget that code" and "can anyone help me with getting my nav menu to highlight the current page" don't help us know what code you want help with.

      Here is the bog-standard YahooSections menu tinkered with to highlight the current page. The changed lines are the ones with // ADDED or AMENDED at the end.
      Code:
      <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
      <!--
      function YahooSections(ar)
      {
      var pagename = document.location.pathname.replace(/.*\//, '');	// ADDED get the page name
      var strIDs = '';
      for (var i=1;i<=ar.length;i++)
        {
        if (ar[i].sURL != null)
          {
          var style = (unescape(ar[i].sURL).indexOf(pagename) > -1) ? 'style="background-color:red;"' : '';	// ADDED set style if on current page
          strIDs += '<a ' + style + ' href="' + ar[i].sURL + '"><span class="actxxsmall"><b><font color="NETQUOTEVAR:FGCOLORCSS">' + ar[i].sName + '</font></b></span></a><br>'; // AMENDED add in style
            {
            if (ar[i].pChild)
              {
              for (var j=1;j<=ar[i].pChild.length;j++)
                {
                if (ar[i].pChild[j].sURL != null)
                  {
      	    style = unescape(ar[i].pChild[j].sURL).indexOf(pagename) > -1 ? 'style="background-color:red;"' : '';	// ADDED set style if on current page
                  strIDs += '<a ' + style + ' href="' + ar[i].pChild[j].sURL + '"><span class="actxxsmall"><font color="NETQUOTEVAR:FGCOLORCSS">' + ar[i].pChild[j].sName + '</font></span></a><br>'; // AMENDED add in style
                  }
                }
              }
            }
          strIDs += '<br>'
          }
        }
      return strIDs
      }
      //-->
      </SCRIPT>
      I've used inline style so it works as-is, but a classname would be better.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        i never did manage to get this method to work Norman, nevermind though i have since changed the structure of my nav menu.

        my menu structure is now manually created using the normal html code for example:

        <ul id="menu">
        <li><a href="colours.html">colour or theme</a></li>

        is there a way i can apply some sort of css if "colours.html" then highlight link type loop?

        i no this sort of css code exist as i have seen it many times, what i do not know is how to get actinic to check current page so i can apply a certain css style.

        Comment

        Working...
        X