pepebe
6/6/2012 - 7:35 AM

MODx: snippet2placeholder

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;