This is an auto-generated support/comment thread for
Personalize 2.0.
Use this forum to post any comments about this addition or any questions you have regarding its use.
Brief Description:
Checks to see if webusers are logged in and displays a chunk if the user is logged or another chunk if user is not logged.
I’m a bit confused (and a newb to all this).
What would be the line I’d insert in my template to display the username?
Helped perfectly.
That was exactly what I needed - and lets me understand the process much better.
Thank you.
David
MODx .95 installed and is working fine on my Server with PHP5 and MySQL5, Apache2, etc..
The Template calls a chunk called "SidebarRight" and inside of this Chunk I call:
[[LoggedOrNot? &yesChunk=`rightChPass` &noChunk=`rightRegister`]]
"rightChPass" just has a link to the page for a user to change their password
"rightRegister" has a link to the registration page
Below this is "[[WebLogin? &tpl=`Login`]]" and this is working perfectly. Personalize 2.0 returns no chunk regardless if the user is logged in or not.
I am pretty new and this is not the first thing that couldn’t get working. Any help is appreciated.
Dedicated CENTOS 5.5 x86_64 standard WHM 11.28.64
Apache/2.2.17 | PHP/5.2.15
MySQL Version 5.0.91 | MODx Revolution
-
MODX Staff
- 12,272 Posts
Try calling it uncached: [!LoggedOrNot? &yesChunk=`rightChPass` &noChunk=`rightRegister`!]
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Thanks for the quick response!
[! - !] didn’t do it. I tried just putting it "[!LoggedOrNot? &yesChunk=`rightChPass` &noChunk=`rightRegister`!]" on a page to test it and it does not work just on the home page either.
Dedicated CENTOS 5.5 x86_64 standard WHM 11.28.64
Apache/2.2.17 | PHP/5.2.15
MySQL Version 5.0.91 | MODx Revolution
Seems it is only listed as compatable with .9.2.1 not .95. My bad.
Dedicated CENTOS 5.5 x86_64 standard WHM 11.28.64
Apache/2.2.17 | PHP/5.2.15
MySQL Version 5.0.91 | MODx Revolution
Is there any timeline for Personalize 2.0 to work with .96? I never did get it working in .95 or .96.
Dedicated CENTOS 5.5 x86_64 standard WHM 11.28.64
Apache/2.2.17 | PHP/5.2.15
MySQL Version 5.0.91 | MODx Revolution
Not trying to step on toes, but perhaps it would be better just to check if the $_SESSION[’webValidated’] is set or either $_SESSION[’webShortname’] is set as opposed to the getloginUserName() call....
someone try this modification and seeif it helps:
# prepare params and variables
$o = '';
$yesChunk = (isset($yesChunk))? $yesChunk : '';
$noChunk = (isset($noChunk))? $noChunk : '';
# do the work
//$test = $modx->getLoginUserName();
//if ($test) {
if(isset($_SESSION['webShortname'])){
$test = $_SESSION['webShortname'];
$o = $modx->getChunk($yesChunk);
} else {
$o = $modx->getChunk($noChunk);
}
if (isset($ph)) {
$modx->setPlaceholder($ph,$test);
return $o;
} else {
return $o;
}