Page 1 of 1

hide sidebar and wrapper

Posted: Mon May 11, 2009 6:19 pm
by curso4
Hello, what I have seen here, the majority are highly trained and can resolve this issue without great difficulty.
The pluggins wrapper allows hide sidebar.
But the template bulletproff regarded as occupied space. What can I do to make the site occupies the entire embedded space freed by the sidebar?

Sorry, I translated from Spanish using Google.
Image
The embedded page is not centered.

Thank you.

Re: hide sidebar and wrapper

Posted: Mon May 11, 2009 9:20 pm
by Don Chambers
under what circumstances do you want to hide the entire sidebar?

Re: hide sidebar and wrapper

Posted: Mon May 11, 2009 10:23 pm
by curso4
When enable "hide sidebar" in serendipity_event_wrapURL.
Is it possible?

Re: hide sidebar and wrapper

Posted: Tue May 12, 2009 9:43 am
by garvinhicking
Hi!

Hm, I believe that's not so easy. The "hide sidebar" option of wrapurl actually only removes all elements inside the wrapping <div> container. But the <div> container is still there (it can't really be removed, because its output is not dynamic).

In past templates this worked because the containers were table <td>s, and if they had no contents, they would shrink to zero size.

Bulletproof seems to check $leftSidebarElements etc. a tad to late, within the <div>. I believe if that IF were moved BEFORE the output of <div>, that the output would be proper. I think the wrapurl plugin should set those two variables to 0.

Regards,
Garvin

Re: hide sidebar and wrapper

Posted: Tue May 12, 2009 5:07 pm
by Don Chambers
I think it is going to be more complicated than what Garvin described. Bulletproof sets classes for the sidebars and content area based on the template configuration (left sidebar, right sidebar, both sidebars, etc). Those classes determine the width of the sidebars and content area. Additionally, bulletproof also has the ability to place navigation in the sidebars, so a sidebar container is still required under that circumstance even if there are no other sidebar items to display.

It COULD be done by changing the logic so that the <div> classes are determined by what actually needs to be emitted, and not just by the sidebar template option.

For what it is worth, my Kinetic template has static pages with the option to suppress all sidebars. I believe the wrapURL plugin merely emits content in an iframe, so you could use a static page and add your own iframe code to contain the external web page.

Re: hide sidebar and wrapper

Posted: Tue May 12, 2009 5:18 pm
by curso4
Thanks, has been a great help.

I added this code in the file serendipity_event_wrapper

Code: Select all

$serendipity['smarty']->assign('oculta_sidebar', $this->get_config('hide_sidebar'));
And changed index.tpl

Code: Select all

       {if $template_option.layouttype == '2sb'}
            <!-- case 4: 2 columns, left sidebar only -->
             {if !$oculta_sidebar}
                <div id="serendipityLeftSideBar" class="twoside layout2sb_left">
                 .... skip ...
                 .....
                </div>
                <div id="content" class="twomain layout2sb_content hfeed">
                   {$CONTENT}
                </div>
             {else}
                <div id="content" class="onemain layout1col_content hfeed">
                   {$CONTENT}
                </div>
              {/if}
         {/if}
and works.
Image Thank you!

Re: hide sidebar and wrapper

Posted: Tue May 12, 2009 5:23 pm
by Don Chambers
Well done - and that is similar to how Kinetic handles it on static pages... checks to see if an option to hide sidebars is set, and if so, uses different classes which in turn use different widths for the content area.

Re: hide sidebar and wrapper

Posted: Tue May 12, 2009 5:39 pm
by curso4
Thanks Don, I have seen kinetic demo and is a very good.

Re: hide sidebar and wrapper

Posted: Tue May 12, 2009 7:13 pm
by Don Chambers
Thanks for the compliments on Kinetic, and once again - great job on your site.