entries in my JHtmlSidebar repeat for multiple times

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
someJmla
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Aug 09, 2018 12:00 pm

entries in my JHtmlSidebar repeat for multiple times

Post by someJmla » Thu Aug 09, 2018 12:10 pm

First of all, hi, thanks for this forum and support of the community.
I'll jump right in...

I'm following the helloworld component example and I've ran into such a problem that I can't even troubleshoot (how would you go around doing this?)

So here's the deal:

I wanted to create a Sidebar with 2 entries and each directing to a view. I used this code in my helper function which exposes a class OwrHelper () ...

Code: Select all

	public function addSubmenu($vName)
	{
		JHtmlSidebar::addEntry(
			Text::_('COM_OWR'),
			'index.php?option=com_owr&view=owr',
			$vName == 'owr_main');

		JHtmlSidebar::addEntry(
			Text::_('COM_OWR_CONFIGURATION'),
			'index.php?option=com_owr&view=owr_options',
			$vName == 'owr_options');
	}
this in my view i simply pull

Code: Select all

<?php echo $this->sidebar; ?>
and in the controller this is the code :

Code: Select all

require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/owr.php';
$controller = BaseController::getInstance('owr');
$controller->execute(Factory::getApplication()->input->get('task'));
$controller->redirect();
Seems that everything is fine, with the ..\Language\Text outputting correctly.
But here is what i get in the administrator/index.php?option=com_owr sidebar:

Image

Looks as though it is rendered 4 times and i have no idea why !
You do not have the required permissions to view the files attached to this post.

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2863
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: entries in my JHtmlSidebar repeat for multiple times

Post by SharkyKZ » Thu Aug 09, 2018 2:46 pm

Check for duplicate addSubmenu calls.


Locked

Return to “Joomla! 3.x Coding”