Hi everyone
I'm strugglig with creating TV based chunks to display different wayfinder menus on different language pages... I'm trying to create a page where you can choose between 4 different languages, I've set up my resources tree as described on various topics like i.e. "en/welcome" and so on..
This is what I have so far.. hope someone can help me on this...
Snippet: (getChunk) from
http://wiki.modxcms.com/index.php/Create_TV-Based_Chunks
<?php
/* Get the category object */
$catObj = $modx->getObject('modCategory',array('category'=>$category));
/* Get the chunk objects in that category */
$chunkArray = $catObj->getMany('Chunks');
$chunkNames=array();
/* Put the chunk names into the array */
foreach($chunkArray as $chunk) {
$chunkNames[] = $chunk->get('name');
}
/* Format the chunk names as a delimited string for the TV */
$l_chunks = implode("||",$chunkNames);
return $l_chunks;
Chunks (4 of them) in category "Selected":
menu_no / menu_en / menu_da / menu_sv
[[Wayfinder? &startId=`2` &level=`4` &outerTpl=`wayfinder_outer_tpl` &innerTpl=`wayfinder_inner_tpl` &hereClass=`current`]]
TV: Radio buttons
@EVAL return $modx->runSnippet('getChunks',array('category'=>'Selected'));
I'm I missing something here? The only thing I want to change is the startId of the wayfinder call, to get the correct menu displayed..
Hope someone could help with this one, or if you have any other ways to do this...
Thanks