WebsiteBaker Community Forum

WebsiteBaker Support (2.11.x) => General Help & Support => Topic started by: henri on March 11, 2018, 09:48:44 AM

Title: Template with slider in WB 2.10 and Template with slider in WB 2.11
Post by: henri on March 11, 2018, 09:48:44 AM
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.
Title: Re: Template with slider in WB 2.10 and Template with slider in WB 2.11
Post by: dbs 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.
Title: Re: Template with slider in WB 2.10 and Template with slider in WB 2.11
Post by: henri 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:
Only registered users can see contents. Please click here to Register or Login.
The same template with slider in 2.11.0 -r77 and PHP-Version: 7.2.2
works with the code below in template.

Code:
Only registered users can see contents. Please click here to Register or Login.
What is the cause of this.
Title: Re: Template with slider in WB 2.10 and Template with slider in WB 2.11
Post by: henri 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.