1
dlrolly
Dynamic Template
  • 2005/3/8 5:00

  • dlrolly

  • Just popping in

  • Posts: 8

  • Since: 2005/2/16


Dear All,
I am assign to create the template but my problem is, the required template changes depending on the user(admin, anonymous,and registered). to give you the picture, it is the left part of the template that changes dynamically.

sample structure of my template:
---------------------------------------------------------------
HEADER

--------------------------------------------------------------
LEFT BLOCK |
|
i want this |
part to dynamically |
change(pic,bgcolor, |
links,etc) |
depending on the user|
logged in |
|
|
|
|
---------------------------------------------------------------
FOOTER

--------------------------------------------------------------

Any idea on how can i accomplish this?

Your Help is greatly appreciated
thanks in advance...

2
Bassman
Re: Dynamic Template
  • 2005/3/8 5:18

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


you'll have to use an if/else structure to achieve this-

<td><{if $xoops_isuser}>
Your stuff
<{else}><{if $xoops_isadmin}>
your stuff
<{else}>
your stuff
<{/if}>
</td>

3
dlrolly
Re: Dynamic Template
  • 2005/3/8 6:04

  • dlrolly

  • Just popping in

  • Posts: 8

  • Since: 2005/2/16


Thanks for your help :).
I have another question, is it possible to call a file(html file) after the condition? this html file contains all the format of the template.
e.g.
admin.html - display if user is admin
user.html - display if user is registered

<{if $xoops_isuser}>
<{$xoops_isadmin}>
display admin.html
else
display user.html
else
some codes here...

I hope u can give me some ideas/advice regarding this...

tnx...

4
LazyBadger
Re: Dynamic Template

Yes, it's possible. Smth. like

<{include file="$xoops_theme/admin.html"}>
...
<{include 
file="$xoops_theme/user.html"}>
...
<{include 
file="$xoops_theme/guest.html"}>

5
dlrolly
Re: Dynamic Template
  • 2005/3/8 6:35

  • dlrolly

  • Just popping in

  • Posts: 8

  • Since: 2005/2/16


thanks for your reply.
I'll try to implement those ideas and i hope they'll work fine ...
thanks...:)

Login

Who's Online

159 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 159


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits