Page 1 of 1
Add contact form
Posted: Tue Feb 07, 2023 8:35 pm
by Hariko
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?
Re: Add contact form
Posted: Wed Feb 08, 2023 2:17 pm
by fraenkiman
Hello Hariko,
welcome on board.
You can edit the template fp-interface/sharedtpls/
contact.tpl for this purpose.
With best regards
Frank
Re: Add contact form
Posted: Wed Feb 08, 2023 3:55 pm
by Hariko
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>
Re: Add contact form
Posted: Wed Feb 08, 2023 6:16 pm
by fraenkiman
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
Re: Add contact form
Posted: Sat Feb 11, 2023 8:00 pm
by Hariko
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>";
}
Re: Add contact form
Posted: Sat Feb 11, 2023 9:27 pm
by Arvid
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 "=":
Code: Select all
return $form . "<p><em>" . $notice_text . "</em></p>";
All the best,
Arvid
Re: Add contact form
Posted: Sat Feb 11, 2023 10:56 pm
by Hariko
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.
Re: Add contact form
Posted: Sun Feb 12, 2023 12:56 am
by fraenkiman
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
Re: Add contact form
Posted: Sun Feb 12, 2023 8:02 am
by Arvid
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