We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15871
    • 105 Posts
    I’m generating a TV that gets the page titles under a certain parent:
    @SELECT pagetitle,id FROM modx_site_content WHERE deleted != 1 AND hidemenu != 1 AND parent = 47 ORDER BY `pagetitle` ASC
    

    All of my documents are under 47 (It’s a list of products) that are categorized in separate folders.

    Here’s my setup:

    Collection (47)
    Sofas (55)
    Product 1 (60)
    Product 2 (61)

    The TV is pulled on the product page and I need it to default to that page’s parent ("Sofas") - I have tried these both and they don’t work:

    @EVAL return $modx->documentObject['parent']; 
    
    @EVAL return $_GET['parent'] 
    


    Any help would be much appreciated smiley
      • 74
      • 74 Posts
      This one works for parent:
      @EVAL $parent=$modx->getParent($id=-1, 1, 'pagetitle'); return ($parent['pagetitle']);
      only if placed in "default value" field.
      TV call on the page returns parent`s pagetitle - works fine.
      Unfortunately, TV like this is unsearchable.
      In SQL table ***_site_tmplvar_contentvalues i have no values for this TV until manual change.
      I cannot understand - is this normal situation for TVs?
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Can you use the @INHERIT binding?
          • 36624
          • 535 Posts
          maybe it can help you : http://modxcms.com/getField-667.html
            CTRL+SHIFT+U - Clear Cache
            CTRL+SHIFT+H - Hiding Heft Panel
            CTRL+SHIFT+N - Fast Create Resource
            CTRL+ALT+P - Preview Recource (in edit resorce window)
            CTRL+ALT+S - Save