Joomla - Custom Text Button Plugin

( 53 Votes ) 

Description

This simple Joomla plugin adds an additional button to the editor page. In plugin parameters you can set any text which will be added to your articles then button is pressed. Can be used with add frequently used phrases or code into your articles (such as custom module positions from Content - Load Modules plugin).

Usage

1. Install the plugin

2. Open Extensions > Plug-in Manager > Button - Custom Text

  • Change status to Enabled
  • Enter your Custom Text
  • Enter Button Label (Optional)

Custom Text Button Plugin Parameters

3. Save changes and open new or existing article

4. Place cursor where you want for your text to appear and press Cust Text Button

Custom Text Button Plugin in Article

Downloads

Download version 1.4

Compatible and tested with Joomla 2.5 and 3.1

Please report all bugs and errors here.

Comments   

Chris
+10 # Chris 2012-09-13 11:30
Is it possible to add multiple buttons - i.e. 1st button with some text, 2nd button with different text, etc.?
Reply | Reply with quote | Quote
admin
0 # admin 2012-09-13 13:36
Not currently. May add this to later versions though.
Reply | Reply with quote | Quote
Mike
+3 # Mike 2012-09-15 13:44
It would be cool if we could set a title for the button in the parameter !

btw good job, thanks.
Reply | Reply with quote | Quote
admin
+1 # admin 2012-09-21 15:21
This is now implemented. Download version 1.1
Reply | Reply with quote | Quote
Vityushka
0 # Vityushka 2012-10-03 10:30
Is it possible to add formatted text?
Reply | Reply with quote | Quote
admin
0 # admin 2013-03-06 14:01
Yes, in version 1.2 you can add HTML code.
Reply | Reply with quote | Quote
lakshmanan
0 # lakshmanan 2012-10-30 13:10
Simple & powerful plugin... class plgButtonMyButt on extends JPlugin { function onDisplay($name ) { $txt = $this->params-> get('my_button' , '[set your custom text in plugin parameters]'); $label = $this->params-> get('label', 'My Button'); $jsCode = " function insertMyButton( editor) { jInsertEditorTe xt('".$txt."', editor); } "; $doc = JFactory::getDo cument(); $doc->addScript Declaration($js Code); $button = new JObject(); $button->set('t ext',$label); $button->set('n ame','blank'); $button->set('o nclick', 'insertMyButton (\''.$name.'\') '); return $button; } }

I've duplicated the class and added few buttons.

Must have plugin...!!!
Reply | Reply with quote | Quote
roman
+1 # roman 2012-12-09 02:04
how to create multiply buttons?
Reply | Reply with quote | Quote
Lakshmanan PHP
0 # Lakshmanan PHP 2012-12-09 17:30
By duplicating the plugin you can create more buttons.

copy and paste custom text plugin. rename it to your button name. lets call it my button.

replace the custom text class name with my button in all occurrences.

Please refer the sample code in my previous comment.

Hope this helps
Reply | Reply with quote | Quote
zefrenchmen
0 # zefrenchmen 2012-12-22 19:39
Pardon the n00b question, but I want to use the buttons to insert a link that comes back often on my site. The button won't hold the html, it strips it to the text itself. Ideas of what I'm doing wrong ?
Reply | Reply with quote | Quote
admin
0 # admin 2013-03-06 14:02
This is fixed in version 1.2
Reply | Reply with quote | Quote
maz2390
0 # maz2390 2013-01-23 02:00
I'm trying to add this code to the button so my bloggers have easier access to a lightbox feature however, it isn't saving it. Maybe because it's too long? It saves it if I delete some of it!
Reply | Reply with quote | Quote
admin
0 # admin 2013-01-23 08:15
What code? Maybe Joomla is stripping it out.
Try setting Text Filters to No Filtering
Reply | Reply with quote | Quote
maz2390
0 # maz2390 2013-01-23 13:18
Quoting admin:
What code? Maybe Joomla is stripping it out.
Try setting Text Filters to No Filtering


this code:

a data-lightbox=" transitionIn:fa de; transitionOut:f ade;" href="/joomla/v antage/images/d emo/gallery/col umn_5/1_big.jpg ">
Reply | Reply with quote | Quote
maz2390
0 # maz2390 2013-01-23 13:20
a data-lightbox=" transitionIn:fa de; transitionOut:f ade;" href="/joomla/v antage/images/d emo/gallery/col umn_5/1_big.jpg " img class="pic3d" src="/joomla/va ntage/images/de mo/gallery/colu mn_5/1.jpg" border="0" alt="fade" width="162" height="104"

had to edit out tags
Reply | Reply with quote | Quote
admin
0 # admin 2013-01-23 13:53
Can you add long text if doesn't have any html tags? Just trying to find out if tags are causing your issue.
Reply | Reply with quote | Quote
maz2390
0 # maz2390 2013-01-23 14:05
Yeah that seems fine
Reply | Reply with quote | Quote
admin
+1 # admin 2013-03-06 14:00
Issue is now resolved. Download version 1.2
Reply | Reply with quote | Quote
Gorgo
0 # Gorgo 2013-04-03 11:17
It's is not possible when I click on button, he add a specific image in the text editor ? (but without pass by toggle editor) I would like he put directly image.

Thanks a lot !
Reply | Reply with quote | Quote
Marco
0 # Marco 2013-04-04 01:44
Any possibility that you can add this feature?
When a user clicks on the custom button, it prompts them to fill in an input field?

Sort of like how the default "page break" button asks for a "Page Title" and "Table of contents alias"
Reply | Reply with quote | Quote
Juhy
0 # Juhy 2013-04-04 07:36
When i click on costum button, the custom text is inserted, but then page go refresh - why? i'm using Google Chrome browser
Reply | Reply with quote | Quote
Jerry Titus
0 # Jerry Titus 2013-04-28 12:37
I'm trying to add the following code to the button but can't seem to get it to display...

Popup link in a 800x600 modal window. Replace *all* of this text with the text to be displayed
 
Reply | Reply with quote | Quote
Jerry Titus
0 # Jerry Titus 2013-04-28 13:00
The code I am trying to enter is the third example on this page, below the picture of the joomla modal.

http://www.ogosense.com/blog/how-to-use-lightbox-in-joomla-25
Reply | Reply with quote | Quote
admin
0 # admin 2013-04-29 10:13
Try placing \ (backslash) in front of ' (single quotes)
Reply | Reply with quote | Quote
Wayne
+1 # Wayne 2013-04-30 16:50
Just installed under joomla 3.1 and the button it creates is invisible - mouseover shows tooltip, and if you click that area it works, but no button shows on the button bar... any ideas?
Reply | Reply with quote | Quote
admin
0 # admin 2013-05-22 07:08
Upgrade to the latest version. Starting v1.3 plugin is Joomla 3.1 compatible.
Reply | Reply with quote | Quote
ARTS
0 # ARTS 2013-05-11 10:10
problems with http://www.joomlackeditor.com/demo-test-drive
Reply | Reply with quote | Quote
tarek
0 # tarek 2013-05-22 12:58
thanks a lot for this excellent little simple plugin :)
Reply | Reply with quote | Quote
Jose Noble
-2 # Jose Noble 2013-06-15 00:41
I have downloaded the plugin but it does not work in joomla 1.5, tells xml installation error
Reply | Reply with quote | Quote
admin
0 # admin 2013-06-17 09:09
It's only been tested with Joomla 2.5 and 3.1
Reply | Reply with quote | Quote
diego
0 # diego 2013-07-17 17:14
fkgknfk
Reply | Reply with quote | Quote
Jesse
0 # Jesse 2013-08-14 03:30
I'm trying to use your plugin with Ari Document Viewer.

I want your plugin to add the text:

{aridoc engine="google" width="500" height="400"}media/k2/attachments/YOUR-FILENAME-HERE{/aridoc}

It works, except Ari Doc processes it when you click the button so the text doesn't appear, just the box where Ari Doc is trying to display a file that hasn't been specified. I did contact them first...they looked into it and said their plugin isn't compatible with yours. So, I'm assuming you won't be able to help, but I wanted to confirm there isn't anything I could do to have it insert the text without Ari Doc processing it before it's published.

Thanks!
Reply | Reply with quote | Quote
dave
+1 # dave 2013-08-18 08:38
Found the download. Enabled plugin and added text. Button wouldn't show and got this error message:

Use of undefined constant PLG_SYSTEM_J2XM L_BUTTON_EXPORT - assumed 'PLG_SYSTEM_J2XM L_BUTTON_EXPORT' in C:\xampp\htdocs \sub\plugins\sy stem\j2xml\j2xm l.php on line 95

Any ideas what the problem might be, please?
Reply | Reply with quote | Quote
admin
0 # admin 2013-08-19 08:58
That error seems to be coming from J2XML plugin.
Reply | Reply with quote | Quote
Automobili┼│ nuoma Ka
0 # Automobili┼│ nuoma Ka 2013-08-23 14:38
Thanks good button
Reply | Reply with quote | Quote
asifagaria
0 # asifagaria 2014-04-13 01:24
This button nothing work joomla zoo or k2
Reply | Reply with quote | Quote
Roli
0 # Roli 2014-05-07 14:58
Button not appearing!
Joomla 3.3 Custom Text Button v1.4 activated.
Any successions?
Reply | Reply with quote | Quote
admin
0 # admin 2014-05-09 16:32
Just tested on fresh 3.3 installation - works fine. Do you have other plugins/compone nts that add similar buttons?
Reply | Reply with quote | Quote
Roli
0 # Roli 2014-05-10 12:09
Thanks for reply. Can't see any failure.
Using the button at bottom of Editor-Window, get the string {loadposition Gallery}. But no Button appears, when the article is displayed.
Reply | Reply with quote | Quote
tanadol
0 # tanadol 2014-05-18 12:12
good
Reply | Reply with quote | Quote
Qian
0 # Qian 2014-09-09 10:23
thanks!I will try it
Reply | Reply with quote | Quote

Add comment


Newsletter

Subscribe to receive occasional updates on new posts.

Your email will not be used for any other purpose and you can unsubscribe at any time.

Privacy Policy                     Login