1
Francesca
block title
  • 2006/8/15 9:14

  • Francesca

  • Just popping in

  • Posts: 9

  • Since: 2006/5/14


hello,
what if I need to not always show block titles?
I tried deleting
<h1><{$block.title}></h1>
from (for example) theme_blockcenter_c.html and adding
<{$block.title}>
in the modules templates where I need to show the block title (for example news_block_top.html) but the variable isn't parsed and I don't get the block title.

Any help? thanks in advance.

2
kurak_bu
Re: block title
  • 2006/8/15 9:45

  • kurak_bu

  • Quite a regular

  • Posts: 342

  • Since: 2005/9/5 1


maybe dont input block title, or if you have to : type:
"----" or "<<--->>"

3
Quest
Re: block title
  • 2006/8/15 12:16

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


You could just delete the block title text from the Blocks Administration for that block.
Have you cloned your template in the admin/system/templates then set the new cloned template to your default template in the admin/system/preferences/general-settings? If you haven't then making changes to the system default templates will not work. You have to clone them first and set the clone to be used for your site.

HTH

Quest

4
stefan88
Re: block title
  • 2006/8/15 12:54

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,
some time ago there was similar question and someone (I don't remember who, but credits and my big THANK YOU! go for him ) came with this:

<if $block.title !="">
    <
div class="blockTitle"><{$block.title}></div>
  </if>


so when the block has empty title, that part is not shown...

..

5
Francesca
Re: block title
  • 2006/8/15 16:20

  • Francesca

  • Just popping in

  • Posts: 9

  • Since: 2006/5/14


yeah, I already considered the idea of not naming blocks but I would end up having too much blocks with no name and it's not very handy.

Quote:

<if $block.title !="">
    <
div class="blockTitle"><{$block.title}></div>
  </if>


Thanx, this will be very useful if I decide to go with empty names.

6
davidl2
Re: block title
  • 2006/8/15 16:25

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


I did see a similar suggestion that would not print the name if it started with a certain group of words - example "ignore".

I'll see if I can find it.

7
davidl2
Re: block title
  • 2006/8/15 16:34

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26



8
Francesca
Re: block title
  • 2006/8/15 17:06

  • Francesca

  • Just popping in

  • Posts: 9

  • Since: 2006/5/14


sounds very interesting, thanks!

[EDIT] That topic has been very useful, I'm going to use this code
<{if $block.title|truncate:5:"" == "invis"}>
<{
$block.content}>
<{else}>
<
h1><{$block.title}></h1>
<{
$block.content}>
<{/if}>

9
Francesca
Re: block title
  • 2006/8/15 18:12

  • Francesca

  • Just popping in

  • Posts: 9

  • Since: 2006/5/14


Why the method doesn't work with the "Recent news" block of the default news module?

If I name it "invis-Recent news" all the entire block doesn't appear anymore. And after renaming it "Recent news" I have to update the module to make it appear again...

why?

It's just that I need to use this structure:

<div id="recentnews">
<
h1>Recent news</h1>
<
block content...>
</
div>


and to make it I need to not show the default block.title otherwise the recent news would show like:
<h1>Recent news</h1>
<
div id="recentnews">
block content...>
</
div>


according to the theme_blockcenter_c.html template
<{if $block.title|truncate:5:"" == "invis"}>
<{
$block.content}>
<{else}>
<
h1><{$block.title}></h1>
<{
$block.content}>
<{/if}>


so I have to add <h1>Recent news</h1> directly in news_block_top.html hard-coding it (hiding the $block.title).

10
Francesca
Re: block title
  • 2006/8/16 14:07

  • Francesca

  • Just popping in

  • Posts: 9

  • Since: 2006/5/14


solved.
<{if $block.title =="Recent news"}>
<
div id="newshome">
<
h1><{$block.title}></h1>
<{
$block.title}>
</
div>
<{elseif 
$block.title|truncate:5:"" == "invis"}>
<{
$block.content}>
<{else}>
<
h1><{$block.title}></h1>
<{
$block.content}>
<{/if}>

Login

Who's Online

204 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 204


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