Forums

Get info about article from within the CF plugin

emmexx 06 Mar, 2014
I want to use CF to inject some data inside joomla articles.
The article would use the CF plugin to get the data:
{chronoforms}myForm{/chronoforms}


But I don't want to inject generic content, I want to create the content based on the article id.
I don't wnat to use info from url or page title because I want to be able to inject content in articles even when using the joomla category menu type, I mean some article displayed with an image, some intro text, so I need the id of each article to create specific content for each article.

Is there any simple way to accomplish that?

thank you
maxx
Max_admin 10 Mar, 2014
Hi Maxx,

Maybe you change check this:
http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2631-how-can-i-get-information-about-the-current-page.html

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
emmexx 10 Mar, 2014


Maybe you change check this:
http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2631-how-can-i-get-information-about-the-current-page.html



Thank you, I had already seen that article but it's not what I need.

I suppose the only way to accomplish what I want is to modify the CF plugin, if it's possible.

bye
maxx
Max_admin 10 Mar, 2014
How do you want to get the article info without using its id ? I think the id will always be available even in category pages, did you test that ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
emmexx 10 Mar, 2014

How do you want to get the article info without using its id ? I think the id will always be available even in category pages, did you test that ?



Actually, I didn't test it.
I have just modified my form and added:
$id = JRequest::getInt('id', '');
echo $id;

That way I get the id of the article if the page is an article but I get the category id if the page is a list of articles.
If the page is a list of articles based on a tag the plugin is not even working (I don't know if there's an option to enable the plugin in tag views).

I tried to use
$doc =& JFactory::getDocument();

to no avail. But I don't know well the joomla API and the joomla documentation system sucks.

I read the documentation about writing plugins and googled for examples on how to get the id of an article and the suggested answer was to use onContentBeforeDisplay(). But I had no time to test that.
And I'm not sure that that is the right way to accomplish what I need for my project. I need it to work in tag views and if the CF plugin doesn't work there, that's a problem.

Thank you
maxx
Max_admin 10 Mar, 2014
I think the plugin will work in category blog view, if the plugin code is in the visible content part (intro text), did you try that ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
emmexx 10 Mar, 2014

I think the plugin will work in category blog view, if the plugin code is in the visible content part (intro text), did you try that ?



I'm not sure I understand what you mean, but the cf tag is in one article, the difference is in the view in which the article is shown.
If I'm viewing the article I see the test output of the form, if I'm viewing a Category list with the introtext of the articles I see the test output of the form, if I select a tag (and my test article has that tag) I see the list of articles with the introtext but ny test articles displays {chronoform}myform{/chronoform} instead of the test output.

Should I open another thread in the bugs board?

thank you
maxx
Max_admin 11 Mar, 2014
So it doesn't work in tags view ? I didn't test that before, maybe there is a tags list setting to enable plugins processing ? I don't know the code changes needed to get the plugin to work in tags list, you can try to hack the plugin code and let me know if you manage to get it working ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
emmexx 11 Mar, 2014

So it doesn't work in tags view ? I didn't test that before, maybe there is a tags list setting to enable plugins processing ? I don't know the code changes needed to get the plugin to work in tags list, you can try to hack the plugin code and let me know if you manage to get it working ?



I don't believe the problem is the CF plugin.
In components/com_tags there are 2 views: tag and tags.
Tag has the code to load plugins JPluginHelper::importPlugin('content'); in view.html.php
Tag has not that code.
But I'm not an expert in the inner workings of joomla.

bye
maxx
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger