conditional tags do not work
Posted: April 19th, 2011, 5:52 pm
Hello,
Conditionals with s2If do not seem to work for me for some reason. Here is what I tried -
1. i changed the post access restriction from level0 to blank (using level 0 only for now)
2. added the following after the more tag in html view
3. When I access the post as a guest, I can see both Protected content and the prompt to register (which would suggest both ifs are succeeding !!). Sometimes I get redirected to membership options page as if there was a post level restriction.
Conditionals with s2If do not seem to work for me for some reason. Here is what I tried -
1. i changed the post access restriction from level0 to blank (using level 0 only for now)
2. added the following after the more tag in html view
- Code: Select all
[s2If !current_user_can(access_s2member_level0)]
If you wish to read further, you would need to be a <strong>[s2Get constant="S2MEMBER_LEVEL0_LABEL" /]</strong>. <a href="[s2Get constant="S2MEMBER_LOGIN_PAGE_URL" /]">Login</a> to your account or if you have not registered with us yet, feel free to <a href="[s2Get constant="S2MEMBER_LOGIN_PAGE_URL" /]?action=register">register</a> to gain access to this content.
[/s2If]
[s2If current_user_can(access_s2member_level0)]
Protected content goes here.
[/s2If]
3. When I access the post as a guest, I can see both Protected content and the prompt to register (which would suggest both ifs are succeeding !!). Sometimes I get redirected to membership options page as if there was a post level restriction.