CustomContent Syntax
-
eleven3
CustomContent Syntax
Hi All,
I am trying to show different content depending on if a user is loggedin and whether or not they are a member of four different groups. To start I test if the user is logged in, and then through a series of nested if statements, I check to see if they are a member of one of the other groups, if they are it displays the content.
Only problem I am having is that this method doesn't work at all. Is there another way to do this?
Thanks a bunch!
{cms_module module=CustomContent}
{content block="Platinum"}
{content block="Gold"}
{content block="Silver"}
{content block="Simple"}
{content}
I am trying to show different content depending on if a user is loggedin and whether or not they are a member of four different groups. To start I test if the user is logged in, and then through a series of nested if statements, I check to see if they are a member of one of the other groups, if they are it displays the content.
Only problem I am having is that this method doesn't work at all. Is there another way to do this?
Thanks a bunch!
{cms_module module=CustomContent}
{content block="Platinum"}
{content block="Gold"}
{content block="Silver"}
{content block="Simple"}
{content}
-
cyberman
Re: CustomContent Syntax
Have you tried elseif instead else (use else only for the last) ?
-
eleven3
Re: CustomContent Syntax
Yes I tried that, this is my second shot.
My apologies for not mentioning that in my problem description.
My apologies for not mentioning that in my problem description.
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: CustomContent Syntax
the comment syntax is very primitive, and doesn't support elseif, or even nested queries, etc.
use the smarty syntax for advanced logic.
use the smarty syntax for advanced logic.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
eleven3
Re: CustomContent Syntax
Calguy - Thanks for clarifying.
I'm really unfamiliar with smarty logic, is there anywhere you can point me to for getting started. Thanks!
I'm really unfamiliar with smarty logic, is there anywhere you can point me to for getting started. Thanks!
-
Zoorlat
Re: CustomContent Syntax
Perhaps this thred can help: http://forum.cmsmadesimple.org/index.php?topic=9478.0
There you'll also find links to other resources concerning Smarty.
/Z
There you'll also find links to other resources concerning Smarty.
/Z
-
eleven3
Re: CustomContent Syntax
I got it working. Thanks to all that helped, here is my solution in case anyone runs into the same problem.
{cms_module module=CustomContent}
{if $customcontent_memberof_Platinum}
Platinum Content
{elseif $customcontent_memberof_Gold}
Gold Content
{elseif $customcontent_memberof_Silver}
Silver Content
{elseif $customcontent_memberof_Simple}
Content
{else} Not logged in {/if}
Message me if you have any questions.
{cms_module module=CustomContent}
{if $customcontent_memberof_Platinum}
Platinum Content
{elseif $customcontent_memberof_Gold}
Gold Content
{elseif $customcontent_memberof_Silver}
Silver Content
{elseif $customcontent_memberof_Simple}
Content
{else} Not logged in {/if}
Message me if you have any questions.
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: CustomContent Syntax
Code: Select all
{cms_module module=CustomContent}if smarty is installed, it is available. and it works. especially if you're using the smarty syntax.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
eleven3
Re: CustomContent Syntax
Calguy,
It turns out the code I posted above doesn't work (even with your edit). Upon logging in, it redirects to a page that should display content based on member level. It doesn't, it just shows the content from the last else statement.
Any thoughts?
I'm going to keep tweaking it, and will post here if I figure it out.
Thanks.
It turns out the code I posted above doesn't work (even with your edit). Upon logging in, it redirects to a page that should display content based on member level. It doesn't, it just shows the content from the last else statement.
Any thoughts?
I'm going to keep tweaking it, and will post here if I figure it out.
Thanks.
-
alby
Re: CustomContent Syntax
Try with plugin: get_template_vars and watch if your variableseleven3 wrote: Calguy,
It turns out the code I posted above doesn't work (even with your edit). Upon logging in, it redirects to a page that should display content based on member level. It doesn't, it just shows the content from the last else statement.
Any thoughts?
I'm going to keep tweaking it, and will post here if I figure it out.
Thanks.
Alby
Re: CustomContent Syntax
Maybe this "else" does not work. You could try:
{content block="Platinum"}
{content block="Gold"}
I tried this once and did not need this at all.
Keijo
{content block="Platinum"}
{content block="Gold"}
I tried this once and did not need this at all.
Keijo

