Page 1 of 1

Extending the {contact_form}

Posted: Fri Oct 22, 2004 5:06 am
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

Extending the {contact_form}

Posted: Fri Oct 22, 2004 2:45 pm
by calguy1000
try copying the plugin to a different name and modifying it. You can then add whatever parameters you like...

Re: Extending the {contact_form}

Posted: Sat Sep 02, 2006 1:52 pm
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...

Re: Extending the {contact_form}

Posted: Sat Sep 02, 2006 10:04 pm
by tcustomgolf
Never mind...I used the Feedback Form Module and all worked out fine...

Re: Extending the {contact_form}

Posted: Thu Jul 26, 2007 1:45 pm
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