Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've continued my extensive search and have found a guide on adding an additional button to the Article Editor for Joomla 1.5.</p> <p>The tutorial is available at: <a href="http://tushev.org/articles/programming/18-how-to-create-an-editor-button-editors-xtd-plugin-for-joomla">http://tushev.org/articles/programming/18-how-to-create-an-editor-button-editors-xtd-plugin-for-joomla</a>.</p> <p>Straight out of the box this won't work with Joomla 2.5 and Joomla 3.0 as the XML manifest standards have changed ever-so-slightly. Keeping in line with the tutorial use this XML manifest instead.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;extension version="2.5" type="plugin" method="upgrade" group="editors-xtd"&gt; &lt;name&gt;test&lt;/name&gt; &lt;author&gt;Name&lt;/author&gt; &lt;creationDate&gt;Month 2013&lt;/creationDate&gt; &lt;copyright&gt;Month Name. All rights reserved.&lt;/copyright&gt; &lt;license&gt;GPL&lt;/license&gt; &lt;authorEmail&gt;Email&lt;/authorEmail&gt; &lt;authorUrl&gt;Your URL&lt;/authorUrl&gt; &lt;version&gt;1.0.0&lt;/version&gt; &lt;description&gt; "adds the button 'test' to the editor" &lt;/description&gt; &lt;files&gt; &lt;filename plugin="test"&gt;test.php&lt;/filename&gt; &lt;/files&gt; &lt;/extension&gt; </code></pre> <p>The tutorial PHP is correct and is as follows:</p> <pre><code>&lt;?php // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); class plgButtonTest extends JPlugin { function plgButtonTest(&amp; $subject, $config) { parent::__construct($subject, $config); } function onDisplay($name) { $js = " function buttonTestClick(editor) { txt = prompt('Please enter something','123'); if(!txt) return; jInsertEditorText('{test '+txt+'}', editor); }"; $css = ".button2-left .testButton { background: transparent url(/plugins/editors-xtd/test.png) no-repeat 100% 0px; }"; $doc = &amp; JFactory::getDocument(); $doc-&gt;addScriptDeclaration($js); $doc-&gt;addStyleDeclaration($css); $button = new JObject(); $button-&gt;set('modal', false); $button-&gt;set('onclick', 'buttonTestClick(\''.$name.'\');return false;'); $button-&gt;set('text', JText::_('Test')); $button-&gt;set('name', 'testButton'); $button-&gt;set('link', '#'); return $button; } } ?&gt; </code></pre> <p>Thank you all for your help. If you have any other better methods I'd be most grateful.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload