[pmwiki-users] How to refer to active page from sidebar?

The Editor editor at fast.st
Tue Jan 9 19:49:15 CST 2007


On 1/9/07, f.r.salomons <salomons at wanadoo.nl> wrote:
> Patrick R. Michaud schreef:
> > On Tue, Jan 09, 2007 at 11:34:10PM +0100, f.r.salomons wrote:
> >> Not having any scripting/programming experience, I need some help.
> >>
> >> 1. For my website, I would like to add an option for visitors to log in
> >> and log out from any page, whilst showing the present
> >> login/logout-status of the visitor. I figured out that this might be
> >> done with something like the following:
> >>
> >> (:if ! authid:) You are not logged in presently. Would you like to
> >> [[{$FullName}?action=login | log in?]]
> >> (:ifend:)
> >> (:if authid:)
> >> You are logged in as {$AuthId}. Would you like to
> >> [[{$FullName}?action=logout | log out?]]
> >>   (:ifend:)
> >
> > Use {*$FullName} instead of {$FullName}.  {*$var} refers to the
> > "active page" instead of the page that contains the markup.
> >
> >> 2. A further question: instead of adding my above-described
> >> login/logout-option to the sidebar, I would also like to be able to add
> >> it to the space between the logo and the searchbox. How can I do that?
> >
> > You would probably need to modify the skin template for this --
> > it depends on the skin you are using.
> >
> > Pm
>
> Thanks a lot, Pm, that is very helpful.
> I have one further question. When I am logged in as admin, this
> information will not be returned by {$AuthId}. Is there another variable
> I can use to let Pmwiki tell me "You are logged in as administrator"?


Use (:if auth admin:). Can also do (:if auth edit:), (:if auth
upload:) or whatever...

Cheers,
Dan




More information about the pmwiki-users mailing list