-
- 0 Posts
Do I see the same page the two pieces of code for two youtube videos
if you watch the trailer is not registered, or if it belongs to the group x, y, watch the whole video
example
group if a <1 youtube video> else <youtube video2>
thank you very much
I think of a snippet, because I create chunks for each page
-
- 24,544 Posts
Something like this should do it (this assumes that you’re using MODX Revolution):
<?php
/* InGroup snippet */
$output = "";
if ($modx->user->isMember('groupA')) {
$output = $modx->getChunk('chunk1');
} else if ($modx->user->isMember('GroupB')) {
$output = $modx->getChunk('chunk2');
} else {
$output = $modx->getChunk('chunk3');
}
return $output;
-
- 0 Posts
brother, thanks for the answer - exactly should I make a call to a snippet
I should call up the page and the snippet of code by inserting pieces of the video youtube
Snippet called as value1 = youtube video code, value2 = 2 youtube video code