Add contact form
Add contact form
I would like to add a note to the contact form that the data will be processed according to the privacy policy. (With link to privacy policy) How can I add the text to the form?
- fraenkiman
- Posts: 113
- Joined: Thu Feb 03, 2022 7:25 pm
- Location: Berlin, Germany
- Contact:
Re: Add contact form
Hello Hariko,
welcome on board.
You can edit the template fp-interface/sharedtpls/contact.tpl for this purpose.
With best regards
Frank
welcome on board.
You can edit the template fp-interface/sharedtpls/contact.tpl for this purpose.
With best regards
Frank
My
Re: Add contact form
Hello Frank,
I have now simply found the right place by trial and error and entered the text there (see below)
It works, but this can not be correct way? Firstly, this looks completely unprofessional and secondly, it will be overwritten during an update or?
greetings
Hariko
</fieldset>
<fieldset><legend>{$lang.contact.fieldset2}</legend>
<p><label for="content">{$lang.contact.comment}</label><br />
{if isset($error) && isset($error.content) && !empty($error.content)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.content) && !empty($values.content)}
{assign var=contentvalue value=$values.content}
{else}
{assign var=contentvalue value=""}
{/if}
<textarea name="content" id="content" class="{$class}"
rows="10" cols="74">{$contentvalue|stripslashes|wp_specialchars:true}</textarea></p>
Wir verwenden deine Daten gemäß unserer <a href="https://xxxxxxxxxxxx.de/?page=datenschutz" title=" Datenschutzerklärung">Datenschutzerklärung</a>
</fieldset>
<div class="buttonbar">
<input type="submit" name="submit" id="submit" value="{$lang.contact.submit}" />
<input type="reset" name="reset" id="reset" value="{$lang.contact.reset}" />
</div>
</form>
I have now simply found the right place by trial and error and entered the text there (see below)
It works, but this can not be correct way? Firstly, this looks completely unprofessional and secondly, it will be overwritten during an update or?
greetings
Hariko
</fieldset>
<fieldset><legend>{$lang.contact.fieldset2}</legend>
<p><label for="content">{$lang.contact.comment}</label><br />
{if isset($error) && isset($error.content) && !empty($error.content)}
{assign var=class value="field-error"}
{else}
{assign var=class value=""}
{/if}
{if isset($values) && isset($values.content) && !empty($values.content)}
{assign var=contentvalue value=$values.content}
{else}
{assign var=contentvalue value=""}
{/if}
<textarea name="content" id="content" class="{$class}"
rows="10" cols="74">{$contentvalue|stripslashes|wp_specialchars:true}</textarea></p>
Wir verwenden deine Daten gemäß unserer <a href="https://xxxxxxxxxxxx.de/?page=datenschutz" title=" Datenschutzerklärung">Datenschutzerklärung</a>
</fieldset>
<div class="buttonbar">
<input type="submit" name="submit" id="submit" value="{$lang.contact.submit}" />
<input type="reset" name="reset" id="reset" value="{$lang.contact.reset}" />
</div>
</form>
- fraenkiman
- Posts: 113
- Joined: Thu Feb 03, 2022 7:25 pm
- Location: Berlin, Germany
- Contact:
Re: Add contact form
Hello Hariko,
the template will be overwritten during an update. You can style the hint text via the corresponding css file.
Alternatively, you can use a plugin and customize it to your needs.
Take a look at the CookieGuard plugin.
With best regards
Frank
the template will be overwritten during an update. You can style the hint text via the corresponding css file.
Alternatively, you can use a plugin and customize it to your needs.
Take a look at the CookieGuard plugin.
With best regards
Frank
My
Re: Add contact form
Hello,
I wanted to create a simple plugin that displays the text directly over the submit button,
but I can't do it. No text appears. What is the reason for this?
Greetings
Hariko
add_filter('fp_contactform_before_submit_button', 'add_notice_text');
function add_notice_text($form) {
$notice_text = "Wir verarbeiten Ihre Daten gemäß unserer <a href='https://www.example.com/datenschutz'>Da ... klärung</a>.";
return $form .= "<p><em>" . $notice_text . "</em></p>";
}
I wanted to create a simple plugin that displays the text directly over the submit button,
but I can't do it. No text appears. What is the reason for this?
Greetings
Hariko
add_filter('fp_contactform_before_submit_button', 'add_notice_text');
function add_notice_text($form) {
$notice_text = "Wir verarbeiten Ihre Daten gemäß unserer <a href='https://www.example.com/datenschutz'>Da ... klärung</a>.";
return $form .= "<p><em>" . $notice_text . "</em></p>";
}
Re: Add contact form
Hi and welcome aboard 
Nice idea, this plugin! And a great plugin example to start with
Without being really involved yet: Your function returns an assignment. Simply remove the "=":
All the best,
Arvid

Nice idea, this plugin! And a great plugin example to start with

Without being really involved yet: Your function returns an assignment. Simply remove the "=":
Code: Select all
return $form . "<p><em>" . $notice_text . "</em></p>";
Arvid
Helpful FlatPress links: Project blog
- FlatPress wiki
- FlatPress@Twitter
- FlatPress@Mastodon 
Stay up to date with our feeds: Forum RSS feed
- Project blog RSS feed 
Feel free to say Thank you: Donate
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4 
Stay up to date with our feeds: Forum RSS feed
Feel free to say Thank you: Donate
Re: Add contact form
Unfortunately, I can't make it work, it's always the same problem with these open-source projects. As a normal mortal user are always quickly reached the limits, and it is assumed that you have to learn before using the program various things, in this case HTML, PHP, CSS and so on. Simply applying is not possible. So, it always remains a tool for enthusiasts. Actually, a pity.
- fraenkiman
- Posts: 113
- Joined: Thu Feb 03, 2022 7:25 pm
- Location: Berlin, Germany
- Contact:
Re: Add contact form
Hello Hariko,
probably an anchor is missing in the template contact.tpl for this. But you can use the anchor {comment_form}, which is normally used by the plugin Accessible Antispam. This also has the advantage that if a visitor wants to leave a comment, he then also gets the reference to the privacy policy displayed. Try this plugin.
Best regards
Frank
probably an anchor is missing in the template contact.tpl for this. But you can use the anchor {comment_form}, which is normally used by the plugin Accessible Antispam. This also has the advantage that if a visitor wants to leave a comment, he then also gets the reference to the privacy policy displayed. Try this plugin.
Best regards
Frank
My
Re: Add contact form
Okay, two steps back: What if you just copy&paste the Leggero theme, and rename the copy to, say, "Hariko"? Then you'd be able to edit the contact form template to your needs without having to fear losing it with the next update.
Let us know if that helps
All the best
Arvid
Update: Ah, I see, Frank created a plugin
Let us know if that helps

All the best
Arvid
Update: Ah, I see, Frank created a plugin

Helpful FlatPress links: Project blog
- FlatPress wiki
- FlatPress@Twitter
- FlatPress@Mastodon 
Stay up to date with our feeds: Forum RSS feed
- Project blog RSS feed 
Feel free to say Thank you: Donate
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4 
Stay up to date with our feeds: Forum RSS feed
Feel free to say Thank you: Donate
Who is online
Users browsing this forum: No registered users and 0 guests