Working with 'ArticlesAnywhere' plugin

More
12 years 1 month ago #14651 by Marc
Hi,
i'm trying to work with placeholders within the events, so i installed a plugin called 'ArticlesAnywhere'.
With this plugin, it is very easy to use placeholders within the event description. I did something like this: my event description is now {article joomla-alias-of-event-description}{text}{/article}.
If i have a lot of events with same content but different start-/end-dates i can change the event description very simple by changing the content of the article 'joomla-alias-of-event-description'. So far so good.

But now i also want to use placeholders within the user email body (under advanced settings). The user email body is being read directly from the database in helper.php. So i can't use my obove technique there.
My last try was to load the article text i want to insert (i.e. the email footer) within the helper.php by article id, but that does not make much sense because it is not very user friendly.

Can anybody tell me how to solve that problem? Cann i fire a simple function in helper.php and get the result which 'ArticlesAnywhere' would give me?

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #14659 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Working with 'ArticlesAnywhere' plugin
Hi

You will need to have a strong PHP / Joomla development skill to do that. Basically, you will need to write code to trigger the content plugin in the code. Please see the sample code below to see how I process content plugin in the description of Event :
Code:
if ($j15) { $dispatcher = & JDispatcher::getInstance(); JPluginHelper::importPlugin('content'); $params = new JParameter(''); $limitstart = 0 ; $article = new stdClass ; $article->catid = 0 ; $article->sectionid = 0; $article->text = $item->description ; $dispatcher->trigger('onPrepareContent', array (& $article, & $params, $limitstart)); $item->description = $article->text ; } else { $item->description = JHtml::_('content.prepare', $item->description); }

In the above code, $item is event record and $item->description is description of the event.

Hope this help !

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc