Page 1 of 1

How to omit one page from the generated menu.

Posted: Wed Jun 07, 2006 1:49 am
by norman
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.

Posted: Wed Jun 07, 2006 10:31 am
by remmo
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

Posted: Wed Jun 07, 2006 11:58 am
by norman
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.