Page 1 of 1
CustomContent - don't see logged on content without a second click
Posted: Mon Mar 05, 2007 4:16 pm
by skypanther
I'm having troubles with CustomContent. I've tried both the smarty and HTML comment syntax and neither is working for me. Here's a summary of the code I'm using:
Code: Select all
{if $customcontent_memberof_students}
... show secure content
{else}
{cms_module module=FrontEndUsers form=login}
{/if}
Here's the issue. User clicks on a link to the Students page (in menu) and is presented with the logon form. They log on. They get the log on form again, no secure content. But, if they click the Students menu link again, they get the page and its secure content.
Page caching is off. I've tried setting the admin prefs to redirect to the group name (the group name specifically matches the page alias). I've tried with various browsers.
CMS-MS version 1.0.2
FEU version 1.1.2
CustomContent version 1.4.4
What's up?
Tim
Edit: I've also tried using {if $customcontent_memberof_students=='1'} and {if $customcontent_memberof_students==1} but it works the same.
Re: CustomContent - don't see logged on content without a second click
Posted: Mon Mar 05, 2007 4:32 pm
by calguy1000
Try upgrading to CMS 1.0.4
Re: CustomContent - don't see logged on content without a second click
Posted: Tue Mar 06, 2007 9:49 pm
by skypanther
Okay, so I upgraded to CMS-MS 1.0.4 and I'm still seeing the same behavior. You log on to FEU and have to click the link to the secure page a second time to see the custom content.
Other ideas?
Tim
Re: CustomContent - don't see logged on content without a second click
Posted: Tue Mar 06, 2007 9:56 pm
by calguy1000
okay, I just went through this last night with another person.
a) make sure you're using the latest version of CustomContent
b) make sure that your pages with customcontent logic, etc, or even the feu tag are marked as non cachable.
c) your customcontent expression should be something like:
{if isset($customcontent_loggedin) && $customcontent_loggedin > 0 }
{else}
{/fi}
Re: CustomContent - don't see logged on content without a second click
Posted: Wed Mar 07, 2007 2:15 pm
by skypanther
Calguy,
I'm using CustomContent 1.4.4.
The Cachable checkbox is definitely not checked on this page.
I tried using this logic:
{if isset($customcontent_loggedin) && $customcontent_loggedin > 0 && $customcontent_memberof_students > 0}
Still, same behavior. After logging on, I get the login form again until I click the menu link a second time.
I'm using FEU 1.1.2. I'm leary of using a beta version on a production site. But, if that's what it will take, I'll try it. How stable is your new beta code?
Tim
Re: CustomContent - don't see logged on content without a second click
Posted: Thu Mar 08, 2007 6:07 pm
by skypanther
bump...
Re: CustomContent - don't see logged on content without a second click
Posted: Thu Mar 08, 2007 6:54 pm
by calguy1000
skypanther wrote:
bump...
Beta1 seems okay, Beta2 is pooched, but a beta3 is upcoming...... it shouldn't have anything to do with FEU though, it's either a customcontent issue, or a cache problem.
btw: {get_template_vars} is your friend when you are debugging these issues, it shows you what variables are defined in smarty, and what their values are so that you can see if your expressions are correct.
I'd recommend you put that in directly above your customcontent logic for debugging purposes. Once it works you can take it out.
Re: CustomContent - don't see logged on content without a second click
Posted: Thu Mar 08, 2007 7:48 pm
by skypanther
Okay, {get_template_vars} shows that no custom content related variables exist on the first load of the page (after logging on) but they're all there after I click the link the second time. So, thinking myself clever, I added this to the template to work around it:
Code: Select all
{cms_module module=CustomContent}
{if !isset($customcontent)}
{literal}
<?php
header('location:'.$_SERVER['PHP_SELF']);
die();
?>
{/literal}
{/if}
But, that didn't work. The code is output as plain text. I tried without the delimiters and I also tried all this on the page itself (though I'd much rather have it in the template so all secure pages inherit the fix).
Is there a smarty way of reloading the page if some template variable doesn't exist?
Tim
Re: CustomContent - don't see logged on content without a second click
Posted: Thu Mar 08, 2007 8:42 pm
by calguy1000
if you'd put that code into a GCB (without the ) called the gcb in your page, it would have worked
otherwise
you have to set the $config['use_smarty_php_tags'] variable in config.php to true
and then use
{php} and {/php}
i.e:
{php} phpinfo(); {/php}
if you can catch up to me in the IRC channel, I may be able to help you out there.
Re: CustomContent - don't see logged on content without a second click
Posted: Thu Mar 08, 2007 9:21 pm
by skypanther
I tried but it ain't working for me. How do I do IRC? I have AIM and YIM accounts but have never used IRC. Do you have an ID or something I need to know?
Tim
Re: CustomContent - don't see logged on content without a second click
Posted: Thu Mar 08, 2007 9:37 pm
by calguy1000
the chat button in the forum main page is a start.
Re: CustomContent - don't see logged on content without a second click
Posted: Mon Mar 12, 2007 2:12 am
by skypanther
I finally came up with a workaround. I added this to my template, within the section
{if !isset($customcontent)}
window.location='index.php?page=students';
{/if}
Crude but effective.
Tim