Page 1 of 1

[Solved] Order in sidebar

Posted: Fri Jan 12, 2018 3:28 pm
by krysttof
Hello everybody !
Can we change the order of the plugins that are displayed in the sidebar ?

Re: Order in sidebar

Posted: Fri Jan 12, 2018 3:40 pm
by Edi
Not yet at the moment. This has be done manually.

Re: Order in sidebar

Posted: Fri Jan 12, 2018 4:00 pm
by krysttof
"This has be done manually."
How to do ?

Re: Order in sidebar

Posted: Sat Jan 13, 2018 1:18 am
by Edi
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>';
}
?>

Re: Order in sidebar

Posted: Sat Jan 13, 2018 11:39 am
by krysttof
Awesome! That's exactly what I wanted. A big thank you for your help.

Re: [Solved] Order in sidebar

Posted: Wed Jan 24, 2018 10:07 pm
by Edi
Also you can do it following this:

viewtopic.php?p=4666#p4666