How to omit one page from the generated menu.

Another automatic cascading menu for Actinic 5 onwards. This one allows more modern DHTML effects.
Post Reply
norman
Site Admin
Posts: 1235
Joined: Sat Feb 07, 2004 9:55 pm

How to omit one page from the generated menu.

Post by norman » Wed Jun 07, 2006 1:49 am

There's no easy way to omit a selection of pages. However it's not too hard to omit just one page.

You need to use a fragment of text that only appears in that page's name. E.g. below it is "Choice".

Edit norcascade_pop_tail.js (in Site1 - back it up first)

look for the lump of code

Code: Select all

    if ( names[I].pChild  && (thislevel <= maxdepth) )
      {
      haschild = true;
      var thisseq = 'mM' + seq++;
      names[I].pChild.id = thisseq;
      if ( OnlyFinalLinks )
        {
        addItem(names[I].sName, thisseq, 'sm:', null, LineHeight, Spacing);
        }
      else
        {
        addItem(names[I].sName, thisseq, 'sm:', null, LineHeight, Spacing).onclick='window.location.href="' + link + '"';
        }
      }
    else
      {
      addItem(names[I].sName, link, '', null, LineHeight, Spacing);
      }
    }

replace it with

Code: Select all

    if (names[I].sName.indexOf('Choice') == -1)
      {
      if ( names[I].pChild  && (thislevel <= maxdepth) )
        {
        haschild = true;
        var thisseq = 'mM' + seq++;
        names[I].pChild.id = thisseq;
        if ( OnlyFinalLinks )
          {
          addItem(names[I].sName, thisseq, 'sm:', null, LineHeight, Spacing);
          }
        else
          {
          addItem(names[I].sName, thisseq, 'sm:', null, LineHeight, Spacing).onclick='window.location.href="' + link + '"';
          }
        }
      else
        {
        addItem(names[I].sName, link, '', null, LineHeight, Spacing);
        }
      }
    }
Look for the line

Code: Select all

if ( names[I].pChild )
and amend it to

Code: Select all

if ( ( names[I].sName.indexOf('Choice') == -1) && names[I].pChild )
and change the word 'Choice' above (2 places) to match something that's only in the section name to be omitted.


Now run the NorCascade configuration program and do "Create Vars". That's it.
Last edited by norman on Tue Jan 30, 2007 1:50 pm, edited 2 times in total.
Norman

remmo
Posts: 3
Joined: Tue Jun 06, 2006 11:01 pm

Post by remmo » Wed Jun 07, 2006 10:31 am

Thanks Norman,

Do I understand correctly that this will only be able to hide one section in the entire site, and not multiple pages?

Thanks for the code. I'll give it a go over the next week or so and let you know how I go.

Remmo

norman
Site Admin
Posts: 1235
Joined: Sat Feb 07, 2004 9:55 pm

Post by norman » Wed Jun 07, 2006 11:58 am

Do I understand correctly that this will only be able to hide one section in the entire site, and not multiple pages?
That's correct (it's what you asked for on your original post).

It's a lot more work to make it work on a list of pages and I have to limit the amount of free customisation I do in order to have some time for myself.

However the concept is there and all you need is a willing JavaScript programmer to extend that top IF to work on a list.
Norman

Post Reply