Skip to content

Instantly share code, notes, and snippets.

@pepebe
Created June 6, 2012 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pepebe/2880482 to your computer and use it in GitHub Desktop.
Save pepebe/2880482 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