You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Joe Sulewski <jo...@cobre.com> on 2002/08/20 15:26:07 UTC
Template Question
Hello,
I wish to put a link in the left.vm template file. However, I only want
the link to show up after a user logs in and I need to know the users
login name. I assume that this can be done with some simple javascript
as the pseudo code below shows:
<script language="javascript">
if (username.equals("")==false){
document.writeln("<a
href="http://mysite.com/jetspeed/mypage?"+username+">Click me</a>");
}
But I'm not sure how to obtain the current user's login name and what
would be the value before someone logs in?
Thanks for you help,
Joe
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Template Question
Posted by Joe Sulewski <jo...@cobre.com>.
Stefan,
Thanks for the pointer, it worked perfectly.
Joe
Stefan Kuhn wrote:
>Hi Joe,
>what you want to do is not a job for JavaScript, but for Velocity (it's a
>server side question, JS is for client side). Have a look in top.vm - it
>shows the login form or not depending on if a user is logged in. For getting
>user name, have a look how the edit account (username) message is made in
>top.vm
>Stefan
>
>Am Dienstag, 20. August 2002 15:26 schrieben Sie:
>
>
>>Hello,
>>
>>I wish to put a link in the left.vm template file. However, I only want
>>the link to show up after a user logs in and I need to know the users
>>login name. I assume that this can be done with some simple javascript
>>as the pseudo code below shows:
>>
>><script language="javascript">
>>if (username.equals("")==false){
>> document.writeln("<a
>>href="http://mysite.com/jetspeed/mypage?"+username+">Click me</a>");
>>}
>>
>>But I'm not sure how to obtain the current user's login name and what
>>would be the value before someone logs in?
>>
>>Thanks for you help,
>>Joe
>>
>>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Template Question
Posted by Stefan Kuhn <sk...@ice.mpg.de>.
Hi Joe,
what you want to do is not a job for JavaScript, but for Velocity (it's a
server side question, JS is for client side). Have a look in top.vm - it
shows the login form or not depending on if a user is logged in. For getting
user name, have a look how the edit account (username) message is made in
top.vm
Stefan
Am Dienstag, 20. August 2002 15:26 schrieben Sie:
> Hello,
>
> I wish to put a link in the left.vm template file. However, I only want
> the link to show up after a user logs in and I need to know the users
> login name. I assume that this can be done with some simple javascript
> as the pseudo code below shows:
>
> <script language="javascript">
> if (username.equals("")==false){
> document.writeln("<a
> href="http://mysite.com/jetspeed/mypage?"+username+">Click me</a>");
> }
>
> But I'm not sure how to obtain the current user's login name and what
> would be the value before someone logs in?
>
> Thanks for you help,
> Joe
--
Stefan Kuhn M. A.
MPI of Chemical Ecology, Winzerlaer Str. 10, Beutenberg Campus, 07745
Jena, Germany
Tel: +49(0)3641 571261 - Fax: +49(0)3641 571202
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>