1
olzenkhaw
How do I hide the title of a custom block?
  • 2007/6/21 7:40

  • olzenkhaw

  • Just popping in

  • Posts: 6

  • Since: 2006/6/29


How can add a custom block but I don wan to show the title of the block? for example, if I wan to put a banner somewhere in the website, I will use custom block to show the banner, but i t will show also the title. I wan to hide the title.

2
incama
Re: How do I hide the title of a custom block?
  • 2007/6/21 7:52

  • incama

  • Friend of XOOPS

  • Posts: 513

  • Since: 2003/10/24


there are two ways, first, don't insert a title when creating the block, second, you can remove the <{&block_title}> that is responsible for showing one of the 8 block-configurations in the theme.html of your theme, which I wouldn't prefer. Use the first option;)
Webdesign
Sitting Ducks?!
I hate politics, give me a stylie instead...

3
olzenkhaw
Re: How do I hide the title of a custom block?
  • 2007/6/21 8:17

  • olzenkhaw

  • Just popping in

  • Posts: 6

  • Since: 2006/6/29


if i don insert the title, it will show also the title bar and then show the content.

4
nachenko
Re: How do I hide the title of a custom block?
  • 2007/6/21 8:26

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


There are theme files for every block position. These can look like this:

Quote:
<div class="blockTitle"><{$block.title}></div>
<div class="blockContent"><{$block.content}></div>


Change first line to this:

Quote:

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


Then leave block title field of your block empty.

5
sato-san
Re: How do I hide the title of a custom block?
  • 2007/6/21 8:54

  • sato-san

  • Quite a regular

  • Posts: 224

  • Since: 2005/7/1 1


Here is a very good solution.

6
tzvook
Re: How do I hide the title of a custom block?
  • 2007/6/21 9:24

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


There is simplyer solution:

you can add this line to your theme files

<{if $block.title|truncate:9:"" == "no-header"}>


and each block name that will start with "no-header" won't have a title

my blocks at the theme files looks like this ( you can do it to all your blocks locations - right, center, left and so ... )

<{if $block.title|truncate:9:"" == "no-header"}>
<
div class="blockTitle"><{$block.title}></div>
<{elseif 
$block.title != ""}>
<
div  class="blockTitle"><{$block.title}></div><{/if}>

<
div style="padding-bottom: 5px;" class="blockContent"><{$block.content}></div>

7
nachenko
Re: How do I hide the title of a custom block?
  • 2007/6/21 10:20

  • nachenko

  • Quite a regular

  • Posts: 356

  • Since: 2005/1/18


tzvook's solution is the sophisticated version of what I suggested, and it's the best solution you'll find. I strongly recommend that.

8
demian
Re: How do I hide the title of a custom block?
  • 2009/12/19 1:18

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


the cool code by tzvook above is wrong..


here is the correct one

i tried it myself..hope it helps ..
<{if $block.title|truncate:9:"" == "no-header"}>
<
div class="blockTitle"></div>
<{elseif 
$block.title != ""}>
<
div  class="blockTitle"><{$block.title}></div><{/if}>

<
div style="padding-bottom: 5px;" class="blockContent"><{$block.content}></div>


tq..this is awesome

9
kris_fr
Re: How do I hide the title of a custom block?
  • 2009/12/19 1:45

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


<{if $block.title}>
    <
div class="xo-blocktitle"><{$block.title}></div>
<{/if}>
 <
div class="xo-blockcontent"><{$block.content}></div>

10
tzvook
Re: How do I hide the title of a custom block?
  • 2009/12/23 21:24

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Quote:

demian wrote:
the cool code by tzvook above is wrong..
tq..this is awesome


It's not wrong , It's an old post, there's a later post in the forums with an explanation about changes in the "truncate" thing with UTF ( the smarty "truncate" is not working with UTF-8 ) ...
all my sits are still using this code

Long time ....

Login

Who's Online

249 user(s) are online (163 user(s) are browsing Support Forums)


Members: 0


Guests: 249


more...

Donat-O-Meter

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

Latest GitHub Commits