We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26931
    • 2,314 Posts
    hi everybody,

    i try to style the links generated via the "OnManagerWelcomeHome" plugin, but it doesn’t pick the css from:
    manager -> media -> style -> MODxCarbon -> style.css
    ... if i add it as inline style to the plugin, it works

    does anyone know what i’m doing wrong?

    thanks, j

    *edit: weeeeird smiley ...it worked right after posting this
      • 26931
      • 2,314 Posts
      hi everybody,

      i customized the above code ( http://modxcms.com/forums/index.php/topic,43572.msg260167.html#msg260167 ) to create a tab on "OnManagerWelcomeRender" which lists all children from folders IDs 15, 16, 17 and 18 in separate uls

      the code is probably really bad, but it works ... since i’m a php noob, i would be very glad if someone takes a quick look at it in order to check if i’m doing something horribly wrong smiley
      // <?php
      
      $e = &$modx->Event;
      $output ='';
      
      switch($e->name) {
      		case 'OnManagerWelcomeRender':
      
      		// set the tpl - can also be done in chunks and use chunk name in the param array
      		$rowTpl = '@CODE: <li><a href="index.php?a=27&id=[+wf.docid+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a></li>';
      		$outerTpl1 = '@CODE: <div class="mwelcomelist"><h1>male dogs</h1><ul>[+wf.wrapper+]</ul></div>';
      		$outerTpl2 = '@CODE: <div class="mwelcomelist"><h1>female dogs</h1><ul>[+wf.wrapper+]</ul></div>';
      		$outerTpl3 = '@CODE: <div class="mwelcomelist"><h1>male cats</h1><ul>[+wf.wrapper+]</ul></div>';
      		$outerTpl4 = '@CODE: <div class="mwelcomelist"><h1>female cats</h1><ul>[+wf.wrapper+]</ul></div>';
      
      		// set params for Wayfinder - params needs to be an array
      		$params1['startId'] = '15';
      		$params1['level'] = '1';
      		$params1['ignoreHidden'] = 'TRUE';
      		$params1['rowTpl'] = $rowTpl;
      		$params1['outerTpl'] = $outerTpl1;
      
      		$params2 = $params1;
      		$params2['startId'] = '16';
      		$params2['outerTpl'] = $outerTpl2;
      
      		$params3 = $params1;
      		$params3['startId'] = '17';
      		$params3['outerTpl'] = $outerTpl3;
      
      		$params4 = $params1;
      		$params4['startId'] = '18';
      		$params4['outerTpl'] = $outerTpl4;
      
      		// execute snippet
      		$mdogs = $modx->runSnippet('Wayfinder', $params1);
      		$fdogs = $modx->runSnippet('Wayfinder', $params2);
      		$mcats = $modx->runSnippet('Wayfinder', $params3);
      		$fcats = $modx->runSnippet('Wayfinder', $params4);
      		break;
             
      		default:
      		$output = '';
      		break;
      	}
      
      $e->output($mdogs);
      $e->output($fdogs);
      $e->output($mcats);
      $e->output($fcats);
      
      return;

      thanks, j