JHtml::_('content.prepare',... not working in my plugin

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
User avatar
bascherz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 245
Joined: Mon Jan 16, 2006 1:33 am
Location: Vienna, VA
Contact:

JHtml::_('content.prepare',... not working in my plugin

Post by bascherz » Sun Apr 15, 2018 8:51 pm

The plugin I am writing needs to be able to run content.prepare on article text pulled from the database before emailing it. So I added a call as prescribed in the first part of this page https://docs.joomla.org/Triggering_cont ... _extension to process the plugins used in the article being emailed. All that happens is the plugin tags are removed from the text. They are not processed to include the content that is properly included when the article is displayed on the site.

Is there a trick to this? What am I doing wrong?

Thanks in advance.
Bruce Scherzinger

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1599
Joined: Fri Jul 05, 2013 10:35 am
Location: Unknown

Re: JHtml::_('content.prepare',... not working in my plugin

Post by SharkyKZ » Thu Mar 28, 2019 6:55 pm

This depends on the plugins. Some plugins, in addition to checking context, also check input variables. So they may run only on specific views, for example. Are you having issues with one of core plugins?

User avatar
bascherz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 245
Joined: Mon Jan 16, 2006 1:33 am
Location: Vienna, VA
Contact:

Re: JHtml::_('content.prepare',... not working in my plugin

Post by bascherz » Sat Mar 30, 2019 12:51 pm

Quite frankly I can't recall clearly. That was a year ago. But I vaguely recall that loadposition didn't work with a module I wrote. There have been several releases since then and we're almost at 4.0. I'll have to give it another try.

--edit--
After posting this and re-reading it, it came off unclearly. But you may have read it correctly. I believe I was trying to invoke the loadposition plugin to load one of my own modules in the plugin I was writing. That's double nesting. I may have decided for myself at the time that may have been asking too much.
Bruce Scherzinger


Post Reply

Return to “Joomla! 3.x Coding”