[Solved] Order in sidebar

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

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: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Not yet at the moment. This has be done manually.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
krysttof
Jr. Bludit
Posts: 6
Joined: Mon Aug 03, 2015 10:05 am

"This has be done manually."
How to do ?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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>';
}
?>
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
krysttof
Jr. Bludit
Posts: 6
Joined: Mon Aug 03, 2015 10:05 am

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

Also you can do it following this:

viewtopic.php?p=4666#p4666
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply