SmartFAQ is developed by The SmartFactory (https://www.smartfactory.ca), a division of InBox Solutions (https://www.inboxsolutions.net)

How can I insert variable parts in a custom block title? I would like the title of a custom block to depend on menu options selected in a left block. How can I do that ? Is it possible to hide the title of a custom block?
This can be done by using only smarty (no hacking): This example shows how to make links of the blocktitle depending on the contents of the <{$block.title}> variable.
<div class="blockTitle">
  <{if 
$block.title =="Recent logs"}> 
      <
a href="<{$xoops_url}>/modules/log/"><{$block.title}></a>
  <{elseif 
$block.title =="Recent posts"}>
      <
a href="<{$xoops_url}>/modules/newbb/"><{$block.title}></a>
  <{elseif 
$block.title =="Recent comments" && $xoops_isadmin}>
      <
a href="<{$xoops_url}>/modules/system/admin.php?module=0&status=0&limit=100&fct=comments&selsubmit=Go%21"><{$block.title}></a>
  <{else}>
        <{
$block.title}>
  <{/if}>
</
div>
<
div class="blockContent">
  <{
$block.content}>
</
div>
If you want the blocktitles to depend on the selected menu option use a smarty variable that only applies to the specific page the user navigated to. Example:
<{if $varibalename == "1" && $block.title =="Recent logs"}> put some html here  <{else}> <{$block.title}> <{/if}>
If needed, create the variable yourself. This will require some hacking. Example: insert this in index.php of a module where you want to change te blocktitle when te user navigates to this page.
$xoopsTpl->assign('varibalename''1');


The comments are owned by the author. We aren't responsible for their content.


Login

Who's Online

284 user(s) are online (1 user(s) are browsing XOOPS FAQ)


Members: 0


Guests: 284


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!

Did you know ?

you can add your own content in a custom block?

Random question

How to install xoops