[Solved] Order in sidebar

Post Reply
krysttof
Jr. Bludit
Posts: 8
Joined: Mon Aug 03, 2015 10:05 am

Fri Jan 12, 2018 3:28 pm

Hello everybody !
Can we change the order of the plugins that are displayed in the sidebar ?
Last edited by krysttof on Sat Jan 13, 2018 11:40 am, edited 1 time in total.
User avatar
Edi
Site Admin
Posts: 1128
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Fri Jan 12, 2018 3:40 pm

Not yet at the moment. This has be done manually.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
krysttof
Jr. Bludit
Posts: 8
Joined: Mon Aug 03, 2015 10:05 am

Fri Jan 12, 2018 4:00 pm

"This has be done manually."
How to do ?
User avatar
Edi
Site Admin
Posts: 1128
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sat Jan 13, 2018 1:18 am

You can take the code of the plugin and build your own sidebar.

The part that is shown in the sidebar is in the file plugin.php following "public function siteSidebar()".

For example the code of the plugin About is the following (line 31):

Code: Select all

public function siteSidebar()
{
	$html  = '<div class="plugin plugin-about">';
	$html .= '<h2 class="plugin-label">'.$this->getValue('label').'</h2>';
	$html .= '<div class="plugin-content">';
	$html .= html_entity_decode(nl2br($this->getValue('text')));
 	$html .= '</div>';
 	$html .= '</div>';

	return $html;
}
You can use for example the following in your sidebar:

Code: Select all

<?php
if( $plugins['all']['pluginAbout']->installed() ){
	echo '<div class="plugin plugin-about">';
        echo '<h2 class="plugin-label">'.$plugins['all']['pluginAbout']->getValue('label').'</h2>';
	echo '<div class="plugin-content">';
	echo html_entity_decode(nl2br($plugins['all']['pluginAbout']->getValue('text')));
 	echo '</div>';
 	echo '</div>';
}
?>
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
krysttof
Jr. Bludit
Posts: 8
Joined: Mon Aug 03, 2015 10:05 am

Sat Jan 13, 2018 11:39 am

Awesome! That's exactly what I wanted. A big thank you for your help.
User avatar
Edi
Site Admin
Posts: 1128
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Wed Jan 24, 2018 10:07 pm

Also you can do it following this:

viewtopic.php?p=4666#p4666
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Post Reply