WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Display content block or not
  • Print
Pages: [1]   Go Down

Author Topic: Display content block or not  (Read 4297 times)

Offline Bennie_wijs

  • Posts: 229
  • Gender: Male
  • I believe what I want to Believe.
    • www.www.motortreffen.net
Display content block or not
« on: March 19, 2009, 03:36:25 PM »
Hello all,

Is there a way to check if a content block will be filled or not??.

More info:
I am building a new template and I am making a display block for a second content block.
But I want this block to be hidden unless the second content block has data.

Can this be done???
Logged
I believe what I want to Believe

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Display content block or not
« Reply #1 on: March 19, 2009, 03:46:27 PM »
Yes.
This is possible.

Please use the search.

One hint: the template "Andreas 06 - falling leaves" hast this functionality built in.

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Display content block or not
« Reply #2 on: March 19, 2009, 03:49:52 PM »
Code: [Select]
<?php 
ob_start
(); 
page_content(2); //When contentblock 2 is used
$content2=ob_get_contents();  
ob_end_clean(); 
if (
$content2<>"") { ?>

    <div class="someclass">
           <?php echo $content2; ?>
    </div>
<?php } ?>

This will work when no content block (2) is added to the page, otherwise there will be some data (about 50 bytes) even on empty blocks.

Ruud
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline Bennie_wijs

  • Posts: 229
  • Gender: Male
  • I believe what I want to Believe.
    • www.www.motortreffen.net
Re: Display content block or not
« Reply #3 on: March 19, 2009, 04:29:07 PM »
Oke,

Will try the code from Ruud and will look at the template "Andreas 06 - falling leaves"

Thanks for the response   :-D
Logged
I believe what I want to Believe

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Display content block or not
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2