• ingenalls

    (@ingenalls)


    I want to use a generic parent page in a sidebar menu instead of creating the same page multiple time as a child page for multiple parent pages.
    For a better explanation see attached PDF file:
    https://www.dropbox.com/s/ew2vfdc1gd4zy36/Website%20menu.pdf?dl=0

    Topic 1
    – Item 1 (child page, topic 1)
    – Item 2 (child page, topic 1)
    – Item 3 (generic parent page)

    Topic 2
    – Item 1 (child page, topic 2)
    – Item 2 (child page, topic 2)
    – Item 3 (generic parent page)

    Instead of creating Item 3 twice I want to re-use the same page for both Topic 1 and Topic 2 (in real life re-use it up to 15 times). My problem is that I am not sure how to keep the menu system intact. If a user is on Topic 1 and clicks Item 3 I want the user to keep the sidebar menu for Topic 1 even though he is viewing Item 3. Same thing goes if the user is on Topic 2, I want him to keep the menu for Topic 2 even if he is viewing Item 3.

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • byanofsky

    (@byanofsky)

    Hi. I may be misunderstanding your question, but are you asking how to assign Item 3 to have multiple parent pages?

    Thread Starter ingenalls

    (@ingenalls)

    Thanks for your help and sorry for being unclear. I updated the chart, hopefully a bit more clear now: dropbox.com/s/s0pz60m16rpp0xw/Website-menu.pdf?dl=0

    Since the page “About” is used in the menu for different parents I can not assign just one sidebar menu to it, because if you are entering from the cat page you are not interested in the dog menu links and vice versa. This is why I am looking for some kind of logic so if the user is entering from the dog page he will see [sidebar menu B] and if he is entering from cat page he will see [sidebar menu C].

    In real life this is going to be used for a travel website, and I don’t want to create the “About” page as a child page to multiple parent pages since the content is going to be exactly the same I only want to edit it at one place.
    At the same time it makes the link structure for the sidebar menu hard. As stated above I would only like the relevant menu to be shown.

    Hope this clarifies my issues.

    byanofsky

    (@byanofsky)

    If you are familiar with a bit of PHP, what you could do is use a query string (such as ?prev_page=dog) that specifies the previous page. Then use PHP GET [https://php.net/manual/en/reserved.variables.get.php] to pull in the parameter. And then a conditional statement for which sidebar to load.

    So in the sidebar menu for cats, your query string parameter will specify cats. And on the dog page, it’ll be dogs.

    Again, this requires a bit of PHP, so it may get too complex. If it does, it may be easier just to create the duplicate version of the page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sidebar menu, different parents and child pages’ is closed to new replies.