<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Determing Login State (MODx)</title>
	<atom:link href="http://www.danielgibbs.net/journal/determing-login-state-modx/feed" rel="self" type="application/rss+xml" />
	<link>http://www.danielgibbs.net/journal/determing-login-state-modx</link>
	<description>Daniel Gibbs&#039; Online Journal</description>
	<lastBuildDate>Fri, 03 Sep 2010 03:10:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Rhepungus</title>
		<link>http://www.danielgibbs.net/journal/determing-login-state-modx/comment-page-1#comment-5054</link>
		<dc:creator>Rhepungus</dc:creator>
		<pubDate>Fri, 05 Feb 2010 16:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielgibbs.net/journal/?p=220#comment-5054</guid>
		<description>Thanks guys, you really helped me out today.  Much appreciated.</description>
		<content:encoded><![CDATA[<p>Thanks guys, you really helped me out today.  Much appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gibbs</title>
		<link>http://www.danielgibbs.net/journal/determing-login-state-modx/comment-page-1#comment-1240</link>
		<dc:creator>Gibbs</dc:creator>
		<pubDate>Fri, 23 Oct 2009 10:18:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielgibbs.net/journal/?p=220#comment-1240</guid>
		<description>Thanks for that Tom, very helpful.

Much appreciated.</description>
		<content:encoded><![CDATA[<p>Thanks for that Tom, very helpful.</p>
<p>Much appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.danielgibbs.net/journal/determing-login-state-modx/comment-page-1#comment-1190</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Thu, 22 Oct 2009 05:47:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.danielgibbs.net/journal/?p=220#comment-1190</guid>
		<description>Thank you.  I needed similar functionality to show a &#039;Logout&#039; link on my page and also an &#039;Update Profile&#039; link.  I ended up creating a snippet similar to yours above.  

As an alternative, though, I tried to use a template variable (tv), which did work so long as your pages that use it in aren&#039;t cached.

For instance, I created a tv called &#039;manageUser&#039;:
   Input Type: text
   Default Value: @EVAL if (isset($_SESSION[&#039;webValidated&#039;])) return &#039;[~76~]&#039;; else return &#039;&#039;;  (document ID [~76~] is the page that displays the user&#039;s profile by calling the WebLoginPE snippet: [!WebLoginPE? &amp;type=`profile` !])
   Widget: Hyperlink
   Display Text: Update Profile

Then I use the &#039;manageUser&#039; tv in my template:

...
&#160;&#160;[*manageUser*]
  


Effectively, I have a footer at the bottom of every page that shows a link &#039;Update Profile&#039; if you&#039;re logged in and nothing if you&#039;re not.

Again, if the page that uses this template has caching turned on, then the tv is evaluated once and cached, so its value never changes if you login/logout.  Major bummer!  I didn&#039;t want to turn off caching for all my pages, so I went the uncached snippet route.</description>
		<content:encoded><![CDATA[<p>Thank you.  I needed similar functionality to show a &#8216;Logout&#8217; link on my page and also an &#8216;Update Profile&#8217; link.  I ended up creating a snippet similar to yours above.  </p>
<p>As an alternative, though, I tried to use a template variable (tv), which did work so long as your pages that use it in aren&#8217;t cached.</p>
<p>For instance, I created a tv called &#8216;manageUser&#8217;:<br />
   Input Type: text<br />
   Default Value: @EVAL if (isset($_SESSION['webValidated'])) return &#8216;[~76~]&#8216;; else return &#8221;;  (document ID [~76~] is the page that displays the user&#8217;s profile by calling the WebLoginPE snippet: [!WebLoginPE? &amp;type=`profile` !])<br />
   Widget: Hyperlink<br />
   Display Text: Update Profile</p>
<p>Then I use the &#8216;manageUser&#8217; tv in my template:</p>
<p>&#8230;<br />
&nbsp;&nbsp;[*manageUser*]</p>
<p>Effectively, I have a footer at the bottom of every page that shows a link &#8216;Update Profile&#8217; if you&#8217;re logged in and nothing if you&#8217;re not.</p>
<p>Again, if the page that uses this template has caching turned on, then the tv is evaluated once and cached, so its value never changes if you login/logout.  Major bummer!  I didn&#8217;t want to turn off caching for all my pages, so I went the uncached snippet route.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
