miken
Newbie   Posts: 1 Registered: 4/2/2007 Status: Offline
|
posted on 4/3/2007 at 01:33 PM |
Is there any way to use an IF function in a theme.html file? for example if
I had a navigation in the theme.html and I want to show a logout and a
login link. how can I make the login link only show if your not loggedin
and the logout link only show if your loggedin?
CMS - PostNuke - 0.7.6.4
AutoTheme - 0.87
Many thanks
Mike
[Edited on 3/4/2007 by miken] |
| |
| |
Shawn
Administrator   Posts: 4549 Registered: 10/7/2002 Status: Online
|
posted on 4/3/2007 at 06:08 PM |
1. Yes you can. You can use PHP in the theme.html, just surround with PHP
tags.
2. Why
AutoTheme already has these built-in. The user-links command shows login
if they aren't and log out if they are.
3. Also, AutoTheme has made extending this simple. Go to AutoTheme admin
> Commands:
- Under Add Command: add a name for your command (that you'll use in the
template) such as login-logout-link
- Under Applies to users: select Anonymous
- Under Action, add some PHP or HTML (surround PHP in PHP tags I think),
like: <a href="http://loginlink....">Login</a>
Then add another command with the same name except for Loggedin users and
use the login link for the action.
Voila... Now when you use login-logout link in a template, it will replace
it with the appropriate code (HTML or PHP) depending upon whether the user
is loggedin or not.
HTH
-Shawn
|
| |
|
|
|
|
Page created in 0.111687 Seconds
|