Pending

User tests: Successful: Unsuccessful:

avatar rvsjoen
rvsjoen
12 Apr 2012

This will make it possible to utilize the toolbar buttons in the frontend if the template specifies the tag. With the current implementation, when the base tag is in effect it will navigate away from the page when toolbar buttons are clicked since it interprets href="#" relative to the base and disregards the query string.

For example, if I have a toolbar in index.php?option=com_foobar the href="#" attribute will refer to "index.php#" which will cause the browser to use the link and navigate away from the page using a GET as it is interpreted as a different page instead of submitting the form using Joomla.submitbutton('task'); and using a POST.

Without the tag this is not an issue as the href="#" attribute will refer to "index.php?option=com_foobar#" and the browser will recognize it as the "current" page.

So far i've found two possible solution to this to I just picked the one which I think is more clear.

<a href="#" onclick="$doTask; return false;">
<a href="#" onclick="event.preventDefault(); $doTask;">

Below is the example code used to generate the toolbar

<?php
jimport('joomla.html.toolbar');
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Standard', 'new',  'New',  'new',  false);
?>
<form action="index.php?option=com_foobar" id="adminForm" name="adminForm" method="post">
        <div id="toolbar-box">
                <?php echo $bar->render(); ?>
        </div>
        <input type="hidden" name="task" value="" />
</form>
avatar rvsjoen rvsjoen - open - 12 Apr 2012
avatar infograf768
infograf768 - comment - 13 Apr 2012

Please add a tracker on joomlacode and put reference here

avatar rvsjoen rvsjoen - reference | - 5 Oct 12
avatar beat beat - reference | 81f9e15 - 10 Sep 13
avatar phproberto phproberto - close - 3 Oct 2013
avatar phproberto
phproberto - comment - 3 Oct 2013

I'm closing this as it's not mergeable and 1 year old. Feel free to open if you update it and are still interested in get it merged.

Thanks for contributing.

Add a Comment

Login with GitHub to post a comment