1
middleton
hack for variable message on each page
  • 2007/1/10 1:36

  • middleton

  • Just popping in

  • Posts: 30

  • Since: 2006/12/21


This small hack will do the following:

* display a welcome message on your home page (this message will differ for guests and logged-in members)
* display a different message on all subsequent pages

In your theme.html, add the following code wherever you'd like the message to appear.

<{if $xoops_pagetitle eq $xoops_slogan}>
     <{if 
$xoops_isuser}>Welcome, <{$xoops_uname}>!
     <{else}>
Welcome to <{$xoops_sitename}>!
     <{/if}>
<{else}>
     
Browsing <i><{$xoops_pagetitle}></i>.
<{/if}>

This could be modified to have a different message in every area, for example:

<{if $xoops_pagetitle eq $xoops_slogan}>Home page msg
<{elseif $xoops_pagetitle == "News"}>News page msg
<{elseif $xoops_pagetitle == "Forum"}>Forum page msg
<{else}>Generic msg
<{/if}>

You'd just have to make sure the text in quotes exactly matches the page title.


Brad