for those being boring after easter… or wanna have phun..
This is a small article which should help ending boring easterevenings. It shows in a very simple example, how to bring a little activity in your sites outfit using possible events or occasions smarty is teached to be able to react on.
!First !
As Always, making changes on your sites ... try this on your testsite first ...! then, please do change settings of your site in Admin ->System ->Preferenzes ->General Settings and turn "Debug mode" to "Smarty Templates Debug", click go! to save settings in database.
Viewing your homepage you will now see a new window with Smarty Debug Console where you find assigned template variables of the acual site for example
"{$xoops_isuser}"
which shows "1" cause i'm actual logged in ... sure you will get nothing "" if you are not logged in.
Knowing that we are allowed to use <{$xoops_isuser}> within theme we can now react on this "event".
This is one possible way to use this knowledge in theme.html:
<{if $xoops_isuser ==1}>
blabla
<{else}>
tralla tralla
<{/if}>
This is the second way which is called myEasterEgg in theme.html:
Using <{$xoops_isuser}> in theme.html will give us "1" for logged in and "" for not logged viewers of our site. Imagine you want to set different headerimages if a person is a logged in or not you will now get 2 different images event each ..using..
named : "headerimage1.gif" & "headerimage.gif".
The third way which is called myBigEasterEgg in theme.html:
As we are teached not to use that images in theme.html but within stylesheet we will make it noble way:
In theme.html:
and in stylesheet:
.headerimage {
background-image:url(../../themes/yourtheme/headerimage.gif);
width:200px;
height:100px;
}
.headerimage1 {
background-image:url(../../themes/yourtheme/headerimage1.gif);
width:200px;
height:100px;
}
This is just a small impression of how to begin playing with smarty engine. With this example you should be able to play with this at places in theme you want. Hu, .. load a different stylesheet for Admins , ..., using :
[of course you must have 2 stylsheets]..
and ... of course ... if Smarty Debug Console does not bring needed smarty .... ask in community if there is a hack or something you can use.. This is power of smarty template engine and xoops, .. just use it!
and now, ... let your head render this ... HAPPY EASTER !
Have Phun !
Michael
For those asking for a sense of this , .., I may have forgotten to place
<{$xoops_user_is_interested}>