Hi,
I’d like to create a site for the school class of my daughter. I want to design two template, one for boys and one the girls. These two designs should be linked to the usergroups boys or girls, is there a chance of getting a snippet or something like that, or a workaround?
Many thanks
derluecke
Now, I’ve test several things.
It works with textstrings, f.e. boys/girls as simple text
It works with chunks, f.e. a calendar chunk
But it just inserts divs or text not whole templates. I receive error message like those above.
olaf
Check
http://www.modxcms.com/TemplateSwitcher-565.html
I remember it could produce links that adds ?template=name
Maybe that can help if you show the users a different navigation menu.
Hi,
yes, it kind of works, could be a beginning, but it’s not as convenient as I hoped it could be. I would prefer a more dynamic way.
But thank you, i will use now and I’m hoping for the solution via usergroups
greetings
Olaf
If you have the plugin installed this might work:
<a href="[~1~][!Template!]">Home</a>
Then have your snippet
Template:
<?php
$output = '';
$boys = $modx->isMemberOfWebGroup( array('Boys'));
if ($boys === true) {
$output .= '|QM|template|EQ|boys';
}
else {
$output .= '|QM|template|EQ|girls';
}
$output .= str_replace("|QM|", "?", $output);
$output .= str_replace("|EQ|", "=", $output);
return $output;
?>
Not sure if that’s the way one put the character replacement
http://modxcms.com/forums/index.php/topic,33101.msg201972.html#msg201972