Skip to content

Instantly share code, notes, and snippets.

@dopsmain
Forked from pepebe/gist:2880482
Created December 30, 2015 06:44
Show Gist options
  • Save dopsmain/b807a3b502fa105d744d to your computer and use it in GitHub Desktop.
Save dopsmain/b807a3b502fa105d744d to your computer and use it in GitHub Desktop.
MODx: snippet2placeholder
<?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