Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
For some reason when I use the 'member_logout_link' tag provided by the member's module inside of the 'capture' tag provided by couch core, I always get 'javascript:void(0)'. I am using the capture tag to remove white space, because in some cases this page sends a JSON response and in other cases it sends out regular HTML output.

Any thoughts on how I can resolve this issue? I'll be happy to provide any further details needed.

Stephen
'javascript:void(0)' is used as the logout link's value when the visitor is already logged out (similarly, the login link defaults to the same value when the visitor is already logged-in). It simply serves to show that the link is not valid in the context of the visitor (someone who is not logged-in cannot possibly logout).

I think that should explain the behavior you are experiencing.

Hope it helps.
Thanks for the response KK.

I apologize but I wasn't clear in my earlier post. I actually am logged in as a member on the page I am viewing, but am still seeing the 'javascript' link.

Basically I have the code below (simplified for example):

Code: Select all
<cms:capture into='temp'>
...
<a href="<cms:member_logout_link />">Logout</a>
...
</cms:capture>

And here is what it outputs:

Code: Select all
<a href="javascript:void(0);">Logout</a>

If I change the code to this:

Code: Select all
<cms:capture into='temp'></cms:capture>
...
<a href="<cms:member_logout_link />">Logout</a>
...

I get the following output:

Code: Select all
<a href="http://www.example.com/login/?act=logout&nonce=4f357d3485bda4c711ff8deb9ca8af54&redirect=%2Flogin">Logout</a>

This is what leads me to believe it is an issue with how the member_logout_link tag performs inside the capture tag, possibly stemming from the $CTX variable, but I don't know enough about the internal working of couch to track it down/fix it.

Stephen
Thanks for the clarification, Stephen :)

I tested out the exact code you posted but could not duplicate the issue - the logout link comes up just fine within <cms:capture /> also (BTW, I am using Couch v2.0 but that shouldn't matter).

Perhaps there is something else in the capture block or the snippet/template that is affecting the output?
I'll have to take a look at the issue first-hand to know anything about it.

If your installation is online, please feel free to PM me the FTP+Couch creds and I'll try to see if I can spot the cause.

Thanks.
Unfortunately this installation isn't online yet, however there is one additional issue which might help you replicate, if you're still willing.

The 'member_logout_link' tag is in an embed file. Here is some code with additional notes to indicate the file structure.

Template being accessed (not cloneable if that matters).
Code: Select all
<cms:capture>
...
<cms:embed 'header.php' />
...
</cms:capture>

Embed file header.php
Code: Select all
<cms:member_check_login />
...
<a href="<cms:member_logout_link />">Logout</a>
...

Does any of that help? If not I can get back to you when this is out on an internet accessible site.

Thanks again for your time and attention.

Stephen
Hi Stephen,

I can't see why using embed would make any difference (that is to say, it would be unexpected behavior if it did).

Could you please let me know once your site is online? I'd like to take a look at this issue first-hand.

Thanks.
6 posts Page 1 of 1
cron