I'm wondering if it's possible to test for the "Content Type" attribute in a template, specifically the "Protected Content" type added by the Frontend Users module.
Some sort of test like...
{if content_type == "Protected Content"}
...display something...
{/if}
Anyone know how to do this?
[solved] Possible to test for Content Type?
[solved] Possible to test for Content Type?
Last edited by Cerulean on Sun Jun 23, 2013 1:54 am, edited 1 time in total.
Re: Possible to test for Content Type?
The Custom Content module has this feature.
Code: Select all
{if $ccuser->loggedin()}
** DO SECRET STUFF **
{/if}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: Possible to test for Content Type?
I think if it is Protected content type it won't show the page in the menu or anywhere else until someone logs in and if they know the URL it most likely will show the log in form or redirect to it, so that wouldn't do anything...
Re: Possible to test for Content Type?
You can try with
See http://apidoc.cmsmadesimple.org/CMS/Con ... iendlyName
Code: Select all
{if $content_obj->FriendlyName() == 'Protected Content'}
do something
{/if}
Re: Possible to test for Content Type?
Thanks for the replies.
For what I needed to achieve I also had success with:
This worked well.uniqu3 wrote:You can try withSee http://apidoc.cmsmadesimple.org/CMS/Con ... iendlyNameCode: Select all
{if $content_obj->FriendlyName() == 'Protected Content'} do something {/if}
For what I needed to achieve I also had success with:
Code: Select all
{if $feu_page}
do something
{/if}
Re: Possible to test for Content Type?
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -