We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40098
    • 9 Posts
    Hi,
    Working on a site for a client and they have 100s of resources available in 8 languages.
    I only want to show a handful of resources in the main navigation (showing all resources would just be a nightmare to navigate).

    For instance:

    Products
    ----Category 1
    --------Product 1
    --------Product 2
    --------Product 3
    ----Category 2
    --------Product 4
    --------Product 5
    --------Product 6
    ----Category 3
    ----Category 4


    I only want to show
    ----Category 1
    --------Product 1
    --------Product 2
    --------Product 3
    ----Category 3
    ----Category 4


    So I want to hide the main 'Products' container, but only show a handful of children within that resource and some of their children.
    The navigation will change for each language (same structure just different pages in each language)

    Without having to specify a massive list( 100s+) of resources to either include /exclude, what's the best way to achieve this?
    I'm really bummed out I couldn't hide a parent container from the menu (using the checkbox) but then have that parents children show. That's the kinda thing I'm after - does anyone know if such a feat is possible?

    I'm after the most efficient way - if possible - without having to use hard coded ID's or actualy <li>link1</li><li>link2</li>

    Any help on the subject would be awesome!

    Thanks,
    Kingsley
    [ed. note: kingsloi last edited this post 14 years, 2 months ago.]
      • 39932
      • 483 Posts
      Assume you are getting this from a Resource. (The solution is the same whether you get it from a Resource, Template, or Chunk). First, you need to make sure and install getResources if you don't have it already. You will require two Chunks.

      getResources call 1 (in Resource):

      <ul>
        [[!getResources?
          &tpl=`Chunk1`  <-- Replace with your Chunk
          &parents=`1` <-- Replace with your Parent
          &limit=`5`      <-- Replace with the number of results you wish
        ]]
      </ul>
      


      getResources call 2 (in Chunk1):

        <li>[[+pagetitle]]
          <ul>
            [[!getResources?
              &tpl=`Chunk2`
              &parents=`[[+id]]` 
              &limit=`5`      <-- Replace with the number of results you wish
            ]]
          </ul>
        </li>
      


      Chunk2:

        <li>[[+pagetitle]]</li>
      
      [ed. note: fuzzicallogic last edited this post 14 years, 2 months ago.]
        Website: Extended Dialog Development Blog: on Extended Dialog
        Add-ons: AJAX Revolution, RO.IDEs Editor & Framework (in works) Utilities: Plugin Compatibility List
        Tutorials: Create Cross-Context Resources, Cross-Context AJAX Login, Template-Based Actions, Remove Extensions from URLs

        Failure is just another word for saying you didn't want to try. "It can't be done" means "I don't know how".
        • 40098
        • 9 Posts
        Hey thanks for the reply,
        I opted for an easier way - removing the 'products' container (it wasn't needed anyway, just a nicer way to house all the products).

        Once I removed the container, I just went through each resource and and checked the "hide from menu" the resource which I didn't want to be shown.

        Thanks anyway!