Author Topic: Template with slider in WB 2.10 and Template with slider in WB 2.11  (Read 5151 times)

Offline henri

  • Posts: 143
Template with slider in WB 2.10.0-RC1 and PHP-Version: 7.2.2
works with the code below in template.

 <?php
if ($contentblock[10] != '') {
echo '<div id="topslider">'.$contentblock[10].'</div>';
} else {
if ($isstartpage) {
echo '<div id="topslider">'; include('responsive-slider/responsive-slider.php'); echo '</div>';
} else {
echo '<div id="headerpic" style="background-image:url('.TEMPLATE_DIR.'/images/top.jpg)"><img  src="'.TEMPLATE_DIR.'/images/top.jpg" alt="" /></div>';
}   
}
?>

The same template with slider in 2.11.0 -r77 and PHP-Version: 7.2.2
works with the code below in template.

<?php
if ($contentblock[10] != '') {
echo '<div id="topslider">'.$contentblock[10].'</div>';
} else {
if ($isstartpage) {
echo '<div id="headerpic" style="background-image:url('.TEMPLATE_DIR.'/images/top.jpg)"><img  src="'.TEMPLATE_DIR.'/images/top.jpg" alt="" /></div>';
} else {
echo '<div id="topslider">'; include('responsive-slider/responsive-slider.php'); echo '</div>';
}   
}
?>

What is the cause of this.

Offline dbs

  • Betatester
  • **
  • Posts: 8803
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Template with slider in WB 2.10 and Template with slider in WB 2.11
« Reply #1 on: March 11, 2018, 11:27:05 AM »
Hello, please use for code the code button (#) in the editor.

You wonder why two different codes work?
A link to the problem page is helpful.

Offline henri

  • Posts: 143
Re: Template with slider in WB 2.10 and Template with slider in WB 2.11
« Reply #2 on: March 11, 2018, 12:41:45 PM »
Template with slider in WB 2.10.0-RC1 and PHP-Version: 7.2.2
works with the code below in template.

Code: [Select]
<?php
if ($contentblock[10] != '') {
echo 
'<div id="topslider">'.$contentblock[10].'</div>';
} else {
if (
$isstartpage) {
echo 
'<div id="topslider">'; include('responsive-slider/responsive-slider.php'); echo '</div>';
} else {
echo 
'<div id="headerpic" style="background-image:url('.TEMPLATE_DIR.'/images/top.jpg)"><img  src="'.TEMPLATE_DIR.'/images/top.jpg" alt="" /></div>';
}

}
?>

The same template with slider in 2.11.0 -r77 and PHP-Version: 7.2.2
works with the code below in template.

Code: [Select]
<?php
if ($contentblock[10] != '') {
echo 
'<div id="topslider">'.$contentblock[10].'</div>';
} else {
if (
$isstartpage) {
echo 
'<div id="headerpic" style="background-image:url('.TEMPLATE_DIR.'/images/top.jpg)"><img  src="'.TEMPLATE_DIR.'/images/top.jpg" alt="" /></div>';
} else {
echo 
'<div id="topslider">'; include('responsive-slider/responsive-slider.php'); echo '</div>';
}

}
?>

What is the cause of this.

Offline henri

  • Posts: 143
Re: Template with slider in WB 2.10 and Template with slider in WB 2.11
« Reply #3 on: March 11, 2018, 01:18:25 PM »
To avoid misunderstandings.

For WB 2.10 and WB 2.11 use the exact same template.
In WB 2.10 the Topslider appears when opening page.
In WB 2.11 the Headerpicture appears when opening page.

In WB 2.11 I want the slider to start when I open the page, then I have to swap the Topslider rule with the Headerpicture rule in the template.

After exchanging the rules, it works perfectly.
But in my opinion this should not be necessary with a template that has not changed anything.