WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: avitaly on August 21, 2009, 08:52:11 AM

Title: showsection droplet works "strangely"
Post by: avitaly on August 21, 2009, 08:52:11 AM
After having upgraded to WB 2.8, "showsection" doesn't work properly. From index.php, it takes the last section of the same page in whicn it is included. So, for example:

Quote
<div class="container">

<!-- bottom left information -->
    <div class="bottomcolumn">
    [[showsection?section=175]]
    </div>

<!-- bottom center information -->
    <div class="bottomcolumn">[[showsection?section=176]]</div>

<!-- bottom right information -->
    <div class="bottomcolumn bottomright">[[showsection?section=177]]</div>
           
        </div>

In the home page (http://agnesevardanega.altervista.org/), you may see section 175 repeated; in another page, where showsection is used before (in the main content: http://agnesevardanega.altervista.org/pages/didattica/sociologia.php), it is this last section to be repeated.

What is happening?
Title: Re: showsection droplet works "strangely"
Post by: crnogorac081 on August 21, 2009, 12:13:51 PM
Hi,

I had the same issue here (https://forum.WebsiteBaker.org/index.php/topic,14928.0.html) :))

It seems you cant use same droplet more than once in template..

I solved it by replacing droplet code with this code:

Code: [Select]
<?php
// Change to the number you need!
$section_id 65;

// Get requested section for requested page
$query_sections $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE section_id = &#39;$section_id&#39; ");

// Make sure there is one
if($query_sections->numRows() > 0) {
    
$section $query_sections->fetchRow();
    
$section_id $section[&#39;section_id&#39;];
    
$module $section[&#39;module&#39;];
    
require(WB_PATH.&#39;/modules/&#39;.$module.&#39;/view.php&#39;);

?>


try, it should work for you too :)

cheers
Title: Re: showsection droplet works "strangely"
Post by: avitaly on August 21, 2009, 12:50:28 PM
It's a kind of magic!  :-D

grazie

PS - added - evidently, it is not possible to use more than one in each page ... and it seems a "new feature" in wb 2.8
Title: Re: showsection droplet works "strangely"
Post by: crnogorac081 on August 21, 2009, 01:18:55 PM
I didnt tested that, bit it would be a great dissadvantage :)

cheers
Title: Re: showsection droplet works "strangely"
Post by: avitaly on August 21, 2009, 02:20:25 PM
I suppose it is so, because in the second page (http://agnesevardanega.altervista.org/pages/didattica/sociologia.php) the first droplet is in the main content section, and it was replicated by the droplets in the index.php (which are collocated after the main content and before the footer).

 :? Maybe the droplet needs to be corrected
Title: Re: showsection droplet works "strangely"
Post by: erpe0812 on August 21, 2009, 02:42:59 PM
Maybe it is a good idea to post this in the droplet thread so the author gets notice of this.

rgds

erpe

Title: Re: showsection droplet works "strangely"
Post by: Argos on August 21, 2009, 02:47:37 PM
I'll move it there.