3

I'd like to develop an extension that processes images and related data using article markup, such as is done by Articles Anywhere, for example:

{article 999}{/article}

In my case it would look something like this:

{myExtension}
[title]
[image HTML]
[image HTML]
[date, date, date, date]
{/myExtension}

The extension would then render title and image markup and generate an HTML structure to present the dates on a timeline of sorts.

Which type of extension(s) is/are needed here, and what's it called when markup in an article is processed? What hooks are to be employed?

Though I've built 100 or more Joomla sites since J! 1.5.9, my professional expertise is in front-end JavaScript libraries and frameworks. You can't be too elementary with me here regarding PHP, MVC, etc. Thanks.

2

I am not absolutely clear about your exact goal. But it seems that you are after creating a content plugin, that will be triggered onContentPrepare event.

The plugin will run when the article is loaded. Within your plugin, you have your onContentPrepare method:

public function onContentPrepare($context, &$article, &$params, $page = 0) {
    //do something 
}

With the &$article parameter, you pass a reference of the current article object (var_dump($article);), so you get access to the contents of your article, e.g. $article->text, which seems to be what you want to process here.

So then, you need to do all that processing for the text of your article.

  1. Identify your custom mark-up
  2. Transform it to your desired HTML

Usually in such cases you need to go with regular expressions.

*You need to have a good plan regarding how your Custom Mark-up will look like.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.