We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19889
    • 616 Posts
    Hello,

    I’m using wayfinder to create the pagetrail - I’ve 4 folders as language containers - the folders are published but not shown in the menu.

    when creating the page trail, I have two issues: first, the home link should refer to the welcome page withing the corresponding language container. second, when I’m on the welcome page, I don’t want to show the home link.

    I found a solution for the second issue:

    	$homeIds		= array(46,47,48,49);
    	$parentId		= $modx->runSnippet('UltimateParent');
    	
    	//if ($modx->config['site_start'] == $modx->documentObject['id']) {
    	if (in_array($modx->documentObject['id'], $homeIds)) {	
    		$homeLink = '';		
    	} else {
    		$homeLink = "<li><a class=\"home\" href=\"{$modx->config['site_url']}\" title=\"Home\">Home</a></li> ".$separator." ";
    	}
    
    


    I created an array ($homeIds) with the id of the welcome pages of the four different languages - if the current document id is in the $homeIds array, I don’t show the home link.

    for the first id, I couldn’t find a solution yet due to my limited programming skills. what I was thinking is that I could get the ultimate parent of the current document. then I could try to figure out what id in the $homeIds is a child of the current ultimate parent. Unfortunately, I don’t know how to do this. maybe there is also an easier way to solve the two issues I’m having.

    In this context, how could I get for instance the alias of a document with a given id - is there some api stuff to do this?

    I hope somebody can help.

    thank you in advance for your input.
      • 7231
      • 4,205 Posts
      Cant help with the programming, but thought I would ask if you have take a look at Breadcrumbs snippet, I think it can handle what you want without any editing but I am not sure.

      http://www.modxcms.com/Breadcrumbs-577.html
        [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&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]