2

After hours of googling and experimenting, I gave up :(

I need to add form to my articles in Joomla 3, that collects data from article's additional fields and emails them. Articles are managed by Flexicontent. Flexicontent overrides standard content manager so I tried to make a plugin inside 'content' plugins (later I tried 'flexicontent' as well). Basing on articles: http://docs.joomla.org/Adding_custom_fields_to_the_article_component http://betweenbrain.com/notes/72-fun-with-joomla-forms https://github.com/joomla/joomla-cms/blob/master/plugins/user/profile/profile.php#L168

which all override some kind of form (user, content or contact).

I made my plugin folder, plugin php file, plugin manifest (xml file) and XMLs with form fields. Then in my php file I wrote onContentPrepareForm(), as instructed. However, when I checked "$this" variable in my flexiconent template, there were no signs of any form. How should I place this form in my template?

I could have used any 3rd party plugin, but then - how can I pass variables from Flexicontent custom fields?

The plugin is installed and turned on

  • We have used rsform PRO and FLEXIcontent before. Tutorial here: bit.ly/2i3fmod – iamrobert Dec 27 '16 at 14:11
4

Both cited articles refer to Joomla content manager.

Even though Flexicontent extends, onContentPrepareForm is not being called or rendered in your Flexicontent configuration.

I suggest to test the plugin in a plain Joomla with a simple article. Once it works as expected. Try to enable it in Flexicontent.

Concerning to "$this", it always refers to the current object instance. If you are in the context of the plugin, it is the plugin. If you are in the context of the template, it is the template. Please, note that onContentPrepareForm renders and returns a string, this string is just concatenated in a template. The custom fields are managed only inside the plugin.

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.