Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Bug reports and fixes
.
Home
Help
Login
Register
Elxis CMS Forum
»
Extensions
»
Bots and plugins
»
Contact Form Code Modification
« previous
next »
Print
Pages: [
1
]
Author
Topic: Contact Form Code Modification (Read 7193 times)
striker
Newbie
Posts: 39
Contact Form Code Modification
«
on:
July 16, 2022, 07:20:58 »
Here's my current scenario:
1. I edited "article.html.php" which is located at */components/com_content/views/
2. Changed the line
Code:
[Select]
echo $row->text."\n";
to
Code:
[Select]
echo $row->introtext."\n"; echo $row->maintext."\n";
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:
[Select]
echo $row->text."\n";
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?
«
Last Edit: July 16, 2022, 07:24:03 by striker
»
Logged
striker
Newbie
Posts: 39
Re: Contact Form Code Modification
«
Reply #1 on:
July 17, 2022, 04:58:42 »
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:
[Select]
echo $row->text."\n";
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
Logged
datahell
Elxis Team
Hero Member
Posts: 10356
Re: Contact Form Code Modification
«
Reply #2 on:
July 17, 2022, 22:23:11 »
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.
«
Last Edit: July 17, 2022, 22:31:03 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Extensions
»
Bots and plugins
»
Contact Form Code Modification