Gossamer Forum
Home : Products : Gossamer Links : Discussions :

tags list, user global

Quote Reply
tags list, user global
Has anyone ever made a list of all the tags that you can use with each template? I realise there is a method of getting the templates to display this, but a handy printed reference with all such tags in the one place would make a nice reference.

The Problem:

I am trying to show the user name on as many of my pages I can (all the dynamically created pages like modify, add, modify_select etc) on my static setup. The aim of this is so the user can "see" their user name on the pages as much as possible, confirming that they are in fact logged in, and that it also is a nice touch I think. (persoanlized login seems pretty commonplace on a lot of sites)

I tried putting <%if Contact_Name%><%Contact_Name%><%endif%> on my modify_select.html page for example, and nothing comes out... just blank.

Do you think it would be easier to create a new global which carries the username and details of the user, which can then be used on all of these pages? Or is there in fact tags which can be used on any page which would display the user name?

Hope this is all readable and understandable!Crazy
Quote Reply
Re: [sooke] tags list, user global In reply to
You could create a global called login_check:

Code:
sub {
my $tags = shift;
my $username = $tags->{Username};
my $login = '';
if ($username){
$login = "You are currently logged in as: $username";
}else{
$login = "You are not logged in"
}
return $login;
}

Then just add <%login_check%> to your template.

Also, I show <%Username%> as being the valid tag. You can add <%GT::Template::dump%> to your template to display the valid commands.

Sean
Quote Reply
Re: [SeanP] tags list, user global In reply to
Hey Thanks!

I am going to give the global a go right nowWink

I did not want to do the dump on a live site..... thats why I was hoping there was a list already floating around.
Quote Reply
Re: [sooke] tags list, user global In reply to
You should also be able to do something like:
Code:
<%if Username eq 'MyUsername'%><%GT::Template::dump%><%endif%>
so that it will only print out the variable dump if it's you logged in.

Adrian
Quote Reply
Re: [brewt] tags list, user global In reply to
Now that does sounds like a great idea, thanks!Smile
Quote Reply
Re: [brewt] tags list, user global In reply to
How can I see a list of tags available for a static page like category.html then?



<%if Username eq 'MyUsername'%><%GT::Template::dump%><%endif%> won't work obviously.



I am trying to work out how I can get the category ID for the current category page being built in category.html.



$tags->('CategoryID')????


http://www.iuni.com/...tware/web/index.html
Links Plugins

Last edited by:

sooke: May 16, 2002, 10:07 PM
Quote Reply
Re: [sooke] tags list, user global In reply to
You can put them on a static page, but then everyone will be able to see them.

You can just put
Code:
<%if Username eq 'MyUsername'%><%GT::Template::dump%><%endif%>
on the page, and you will have to use the dynamic mode to see what tags are available.

That's the easiest solution, I think.

Ivan
-----
Iyengar Yoga Resources / GT Plugins