We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2591
    • 10 Posts
    This topic like commit through forum smiley

    One day i’d need draw links for documents who stored in same level as current document, i.e. something like "neighbours".
    And hadn’t find better way that add this in snippet Wayfinder (snippet itself, database stored one)

    BEFORE (about 40 line):
    $wf->_config = array(
    


    Insert this:
    // improved by Azrael (azrael.com at gmail.com)
    if (!strcasecmp($startId, 'parent')) {
    	$startId = array_shift(mysql_fetch_row($modx->db->select('parent', $modx->db->config['table_prefix'] . 'site_content', 'id = ' . $modx->documentIdentifier)));
    }
    // -END-
    


    Now if you call snippet like:
    [[Wayfinder? &startId=`parent`]]

    you’ll get menu with documents, who have same parent, as current document, including itself. Case insensitive.

    I:

    • don’t read all forum and if this already been, i dont care. ignore it
    • dont care about comments, just for search and diff
    • would glad if Kyle Jaebker or Ryan Thrash feedback this post, email better
    • would glad if anyone commit to svn if project still live
    • sorry for english, bad school, you know..

    Full code in attach
      If you send people to google, it means that you know nothing about question, so keep quiet, please...
      • 7231
      • 4,205 Posts
      Interesting. I think that you could do the same thing by calling:
      [[Wayfinder? &startId=`[*parent*]`]]
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 2591
        • 10 Posts
        Dow...
        I had feeling that it can be done with simplest method.
        Its all my laziness.

        Thanks, dev_cw. grin
          If you send people to google, it means that you know nothing about question, so keep quiet, please...
          • 7231
          • 4,205 Posts
          Yours is a good patch, not too lazy at all. In modx there are often several ways of doing things grin

          You can use any of the document variables (and template variables as well) in your snippet calls.
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]