10 years ago
1
Topic

Hello,

I need to create my own form html output for a contact form.


I'm using a position override with seb_minima template. There I define my own form layout in seb_minima/positions/contactform/site/mainbody.php


How do I call the form so that I get the right attributes in the <form> tag, the javascript for correct form submission and the correct token.

All these are created automatically when I use seb_one template. But I need to have more control over the layout. So I need to create a working form code in my position override.


Couldn't find anything related in the forum here and in the old forum.


Please help, thank you.

Get a VIP membership
10 years ago
0
Level 1

To partially answer my own question:

I call the fields in my position override with

<?php echo $cck->renderField('field_name'); ?>

The openeing and closing <form> tags with the correct attributes get added automatically, also the hidden fields and the javascript for submission. So the form is working :-)


But in seb_minima the labels do not get rendered together with the fields.


So I added for every field where I want to have a label:

<label><?php echo $cck->get('contact_surname')->label; ?></label>

But here the asterisk * for required fields doesn't get rendered.


How can I get the complete fields rendered with labels that show the * for required fields?

Get a Book for SEBLOD