We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8454
    • 55 Posts
    Solved: please see: http://modxcms.com/forums/index.php/topic,13575.0.html
    EDIT: Maybe the below is overly complicated. To put it simple:
    How do I pass the id of a page I am coming from to the page I am going to, when clicking a link ?

    It must be dead simple, a query string and a $_GET or what? Sorry, I don’t know php...


    Well, I have a navbar with product groups. These are pagetitles displayed by Wayfinder. Each product group is a document in the backend, one being All products. Then there is a submenu, with the actual products, these are also documents in the backend. Since a product may belong to several product groups and should be easy to assign to more than one, a one-to-one representation of the document tree presented by e.g. Wayfinder wont work. It would lead to redundant duplicates of the same product.
    I solved this with a checkbox TV Productgroup with values corresponding to the pagetitles of the product group documents. The submenu with products is realised by Ditto and filtering:
    [!Ditto? &parents=`56` &filter=`ProductGroup,[*pagetitle*],7` &tpl=`NavbarItem` &tplCurrentDocument=`CurrentNavbarItem`!]

    I have yet to find out how to update the TV:s valuelist dynamically with a binding pointing to the pagetitles in the db. If you have a better solution for this first hurdle, please speak out.

    In the backend all the products are children of the document All products, just to keep them somewhere logical for now, might be handy later on.

    NOW to the real issue: Say I have chosen product group Outdoor. When I click a product link, Hood shirt in the then presented submenu and go to the product page, I need MODx to remember what Product group was selected so that the submenu stays intact showing all the alternative products I didn’t click AND have the product group Outdoor in the navbar still higlighted, i.e. pass some parameter to the product page I land on.