code snippets - Modx - Getting the current context -


i have 2 contexts , use snippet current context. snippet working properly, when use in getresources call, not passing snippet value.

     [[getresources?            &parents=`0`           &limit=`10`           &depth=`0`           &tvfilters=`cb_show_in_top_bar_menu==1`           &includetvs=`1`           &includetvlist=`cb_show_in_top_bar_menu,cb_hash_link_menu`                         &tpl=`chk-top-menu-item`           &sortdir=`asc`           &sortby=`menuindex`           &context=`[[!context]]`         ]] 

the context snippet

return $modx->context->key; 

can tell me how can done.

what have right, getresources. ~ try calling uncached. if not, try setting context key context setting can call [[++context_key]] or in context snippet set placeholder:

[[!context]]  [[!getresources?            &parents=`0`           ...            &sortby=`menuindex`           &context=`[[+context_key]]`         ]] 

!context

$key = $modx->context->key;  $modx->setplaceholder('context_key', $key);  return; 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -