Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-07-27 20:57:04

jmpeduto
New Member
From: Buenos Aires
Registered: 2010-07-27
Posts: 2

hi, need help on plugin development basis..

Hi, can any one help me on how to replace an html element in the admin side? I need to change the textarea with id “Body” in event article by other one, mantaining the origina behaviour.. this text area is the default plain text editor for publishin a new article. I don´t know how to add javascript or html code to an event.

Thanks! I´m newie on txp, sorry.

Offline

#2 2010-07-27 21:06:22

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: hi, need help on plugin development basis..

jmpeduto wrote:

I need to change the textarea with id “Body” in event article by other one, mantaining the origina behaviour..

Hi, and welcome. You’ll be needing to make your simple plugin using a callback then.

The best place to find the callbacks is in the Core Callback List. The one you’ll want to hook into is event="article_ui", step="body". That’ll give you direct access to the markup that renders the Body textarea.

Then take a look at Using callbacks for some more info. There’s also an example plugin if you scroll down to the Altering admin side markup: pluggable_ui() section of that article.

In your case you can either scrape through the contents of parameter #3 and replace the HTML you find there with your own stuff and return it, or you can just return your own code directly (or append to the existing content if you prefer).

Hope that gets you going in the right direction. Holler if you need any more help.

EDIT: Oh, and if you want a handy interface for creating plugins, try the ied_plugin_composer plugin

Last edited by Bloke (2010-07-27 21:09:20)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2010-07-28 15:11:51

jmpeduto
New Member
From: Buenos Aires
Registered: 2010-07-27
Posts: 2

Re: hi, need help on plugin development basis..

Thanks a lot Bloke! One more question.. So, following those steps, could I insert some jquery code into the page?

Offline

Board footer

Powered by FluxBB