Extending the {contact_form}

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
BamaRob

Extending the {contact_form}

Post by BamaRob »

I'd like to add a title to the contact form. Should I modify the code for the contact form plugin (ack! whenever I upgrade cms, I'd have to reapply my changes), or could I do it with a user defined tag? Can you code user defined tags so that they accept variable in put? I.e.:

Code: Select all

{my_tag title="Email Mr. Smith" email="joesmith@somewhere.com"}
Then my user defined tag would return:

Code: Select all

<p class="smalltitle">Email Mr. Smith</p>
{contact_form email="josmith@somewhere.com"}
Am I making any sense? Seems like I'm trying to code in circles! Perhaps I just need to take the existing contact_form and create a new one, say titled_contact_form, and modify the code so that you would use it like this:

Code: Select all

{titled_contact_form title="Email Mr. Smith" email="joesmith@somewhere.com"}
Any suggestions?

Actually, now that I think about it... It'd be even cooler (and perhaps more useful) if you had it where contact_form with no email argument automatically snagged the page owner's email address. If an email argument were given, it'd use that. Is that doable? I may take a look at the existing code behind contact_form to see if I can implement this.

BR
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Extending the {contact_form}

Post by calguy1000 »

try copying the plugin to a different name and modifying it. You can then add whatever parameters you like...
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
tcustomgolf

Re: Extending the {contact_form}

Post by tcustomgolf »

Has anyone had any luck with this?

I've copied the function.contact_form.php to another file name, made my modifications (I want to have to different forms on my site), then uploaded it to the plugins directory.  When I go to the TAGS menu item in admin, it just brings up a blank screen??  Even tried to copy the contact form code into a user defined tag, but with no luck...

Any help would be appreciated...
tcustomgolf

Re: Extending the {contact_form}

Post by tcustomgolf »

Never mind...I used the Feedback Form Module and all worked out fine...
SimonSchaufi

Re: Extending the {contact_form}

Post by SimonSchaufi »

i have the same problem now in 1.0.8. i modified the filename and the functions in the file but i also get a blank page after uploading the new file.

I have translated the contact form to german but i still want to use the english one too, so i need both tags:

filename: function.contact_formular.php

smarty_cms_function_contact_formular( ...

smarty_cms_help_function_contact_formular( ...

smarty_cms_about_function_contact_formular( ...

You MUST change the other functions too, then it works
Last edited by SimonSchaufi on Wed Aug 01, 2007 2:16 pm, edited 1 time in total.
Post Reply

Return to “Developers Discussion”