-
-
Save dopsmain/b807a3b502fa105d744d to your computer and use it in GitHub Desktop.
MODx: snippet2placeholder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
snippet2placeholder | |
by Bruno17 | |
http://www.modxcms.de/forum/comments.php?DiscussionID=5524#Item_4 | |
Create placeholder from a snippet, for example wayfinder | |
[[snippet2placeholder? | |
&snippet=`Wayfinder` | |
&startId=`1` | |
&level=`1` | |
&placeholder=`wfoutput` | |
]] | |
Output placeholder: | |
[[+wfoutput:isnot=``:then=`<div class="nav">[[+wfoutput]]</div>`:else=`Resource hat keine Kinder`]] | |
*/ | |
$output = $modx->runSnippet($snippet,$scriptProperties); | |
$modx->setPlaceholder($placeholder,$output); | |
return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment