Page 1 of 2

3.2 sidebar

Posted: Wed Aug 07, 2019 8:02 pm
by testingground
Can anyone tell me how to add a sidebar on the left, under the banner/navbar.
ie the banner and navbar is full width and the sidebar goes at the side of the boards etc

thanks

Re: 3.2 sidebar

Posted: Thu Aug 08, 2019 12:14 am
by Lumpy Burgertushie

Re: 3.2 sidebar

Posted: Thu Aug 08, 2019 6:22 am
by testingground
I want a sidebar that goes UNDER the banner as I said in my post.
Thanks but that one doesnt.

Re: 3.2 sidebar

Posted: Thu Aug 08, 2019 11:07 am
by Mannix_

Re: 3.2 sidebar

Posted: Thu Aug 08, 2019 5:58 pm
by Lumpy Burgertushie
Hi, here is one that does what you want.
https://phpbbace.com/phpBB325/index.php

create a custom style;

copy prosilver, rename the folder and edit the style.cfg file and rename prosilver to whatever you named the folder.

upload to your styles folder on the server and install this style and use it.

now, using a good text editor only,
create a new file named sidebar_left.html and put whatever html code you want in it for your sidebar.
save it in the templates folder of your new custom style.


now, still using your text editor, open overall_header.html in the copy of your new style on your computer.

at the bottom, add:

Code: Select all

<div id="sidebar_left">
<!-- INCLUDE sidebar_left.html -->
</div>
<div id="content_center">
save file.

open overall_footer.html
at the top, add:

Code: Select all

</div>
save file.

open common.css
at the bottom, add:

Code: Select all

#sidebar_left {
float: left;
width: 16%;
margin-bottom: 10px;
}

#content_center {
padding-left: 1%;
padding-right: 1%;
margin-bottom: 10px;
float: right;
width: 82%;
}


@media (max-width: 1000px) {
 #sidebar_left { display: none; width: auto; float: none; margin-right: 0; }
  #content_center { width: 100%; margin: 0 auto; clear: both; float: none; }
}
save file.

upload all three files back to your custom style on the server.
purge the cache.

you can edit the css to change the percentages etc.

robert

Re: 3.2 sidebar

Posted: Sat Aug 10, 2019 8:36 pm
by testingground
Thanks

Re: 3.2 sidebar

Posted: Sun Aug 11, 2019 7:34 am
by testingground
Hi, the above code didnt put the sidebar at the side, it just put it between the header and the boards

Re: 3.2 sidebar

Posted: Sun Aug 11, 2019 3:42 pm
by Lumpy Burgertushie
need to see what you have. it worked perfectly for me on the test board as you can see here: https://phpbbace.com/phpBB325/index.php

therfore, you are either using a different style or you made a mistake somewhere.

robert

Re: 3.2 sidebar

Posted: Tue Aug 13, 2019 8:02 am
by testingground
Ok thanks I sussed it, was my error.

Problem is I only want the side bar on the index page.
This code puts the sidebar on every page

Re: 3.2 sidebar

Posted: Tue Aug 13, 2019 8:14 am
by warmweer
testingground wrote:
Tue Aug 13, 2019 8:02 am
Problem is I only want the side bar on the index page.
This code puts the sidebar on every page
Because it's in overall_header.html (something you can change).

Re: 3.2 sidebar

Posted: Tue Aug 13, 2019 8:30 am
by testingground
Yea I realise this, but Ive tried to change it but not sure where to put the code

Re: 3.2 sidebar

Posted: Tue Aug 13, 2019 8:36 am
by warmweer
testingground wrote:
Tue Aug 13, 2019 8:30 am
Yea I realise this, but Ive tried to change it but not sure where to put the code
index_body.html? perhaps forumlist_body.html (this will be more difficult I think).

edit: not index_body as this would appear almost everywhere again

Re: 3.2 sidebar

Posted: Tue Aug 13, 2019 8:45 am
by 3Di

Code: Select all

{% if SCRIPT_NAME eq 'index' %}
	//your code here
{% endif %}
Should do.

Re: 3.2 sidebar

Posted: Tue Aug 13, 2019 10:59 am
by testingground
cannot find this code in the forumlist_body??

Re: 3.2 sidebar

Posted: Tue Aug 13, 2019 11:27 am
by warmweer
testingground wrote:
Tue Aug 13, 2019 10:59 am
cannot find this code in the forumlist_body??
That code doesn't exist (yet)
3Di is showing you how to ensure the code (which you still have to write) will only be execuded if the name of the calling script equals index.....
So my guess is that you can include the code in overal_header.html. (not something I can confirm without looking at the html)
Trying it is a simple way to find out if it works.