Extensions > Bots and plugins

Contact Form Code Modification

(1/1)

striker:
Here's my current scenario:

1. I edited "article.html.php" which is located at */components/com_content/views/
2. Changed the line
--- Code: ---echo $row->text."\n";
--- End code ---
to
--- Code: ---echo $row->introtext."\n"; echo $row->maintext."\n";
--- End code ---

I had to make this change since I want to insert advertisement in between the introtext and maintext.

With this change it directly affected the contact form plugin since it uses the combined
--- Code: ---echo $row->text."\n";
--- End code ---
It won't display the fields of the contact form but will only show{contact}noone@example.com{/contact}.

What's the proper way of editing the contact form plugin "contact.plugin.php" to make it work with the modification I made in article.html.php?

striker:
So, I checked the plugin development guide>> https://www.elxis.net/docs/developers/tutorials/plugins-guide.html

and it seems that all plugins render html output using
--- Code: ---echo $row->text."\n";
--- End code ---

My initial solution for now is to make a conditional statement;

if($seolink =="*contact-us.html") {echo $row->text."\n";}

if($seolink !="*contact-us.html") {echo $row->introtext."\n"; echo $row->maintext."\n";}

So far, so good :)

But I am still interested how to modify/develop plugins without the use of $row->text :)

datahell:
Traditionally a plugin is an extension that performs find and replace to a given text. You write an "integration" or "short" code in your article, module, or whatever, and the plugin replaces that code with other HTML code. However it is not required to perform search and replace. More over it is not even required to integrate the plugin to an article! In Elxis you can create a plugin that runs automatically wherever you want without integrating it into content items (articles, modules, shop products, whatever).

I strongly advice you not to modify Elxis core (components, modules, plugins, etc). In order to place an advertisement between the intro and main text, or where ever you want, just create, or use, a plugin and integrate it in the exact position you want to be displayed. I don't get why you modified Elxis core for that.

Navigation

[0] Message Index

Go to full version