Page 1 of 1

Swapping sidebar order

Posted: Sun Jan 17, 2016 11:24 pm
by DarrenDriven
I'd like the Tags to display before/above the Page list on the sidebar but I'm not sure which script contains the order of those items so I can switch them around.

The script that calls for the sidebar is /site/themes/future-imperfect/php/sidebar.php with this line:

Code: Select all

<?php Theme::plugins('siteSidebar') ?>
Then I can find the next bit of HTML for the Pages list in siteSidebar() in /site/plugins/pages/plugin.php.

But then immediately after that the same-named function is run in /site/plugins/pages/tags.php.

There has to be another bit that I am missing where the order of these functions is set. I just can't seem to find it.

Re: Swapping sidebar order

Posted: Wed Jan 20, 2016 5:19 am
by acrox999
I believe there's a field called "position" in the databases of the plugins, which is most probably used to position them just like the Pages positioning. You can edit the db.php of each of the plugins that you wish by going to /content/databases/plugins/<plugin-name>/db.php and change the value of the "position" field.

And regarding the "Theme::plugins('siteSidebar')" that is just a function used to call the plugins that is placed on the sidebar. There's also siteHead, etc. So this function calls the tags and pages plugin.

EDIT: I tried it myself. Looks like it doesn't work, or maybe that wasn't the purpose of it. It's kind of hard to figure this out since the plugins still do not have their own documentations yet.

Re: Swapping sidebar order

Posted: Wed Jan 20, 2016 6:23 am
by DarrenDriven
I'm usually pretty good at tracing though scripts to figure this stuff out, but after 30+ minutes I decided to go to the source. Hopefully one of them will pop in here soon. :)

Re: Swapping sidebar order

Posted: Wed Jan 20, 2016 4:57 pm
by dirtdiver2010
As far as I know, it is not possible to move the order at the moment.

Re: Swapping sidebar order

Posted: Wed Jan 20, 2016 7:09 pm
by DarrenDriven
Well ANYTHING is possible in PHP, you just need to know what snippet of code to put where.

Sure, it may not be a configuration option right now, but editing the code can change anything.

For example, check out my tag filter dropdown list sort action that I added to my script in the sidebar:
http://idrewyourcar.com/

Right above it is the Timelines (pages) list that I want to display underneath.

Re: Swapping sidebar order

Posted: Wed Jan 20, 2016 8:30 pm
by dirtdiver2010
;) ok, that´ s true...

Re: Swapping sidebar order

Posted: Sat Mar 05, 2016 10:40 am
by morvy
Hi guys, as plugins are loaded in alphabetical order by listing bl-plugins directory, easiest way to reorder plugins is to rename their folders, so for example 01_pages, 02_recent_posts, 03_tags .. and if you already changed default configuration of plugins, you need to rename their "database" folders. It's just a workaround, not proper solution, but I hope it helps somebody..