Form alteration
Permalink
Hey all,
I am really enjoying my time with concrete5. Just have a request to alter the original form block layout. Right now the form block text is to the side of the actual input field itself when I actually want the text to be on top.
I have added some pictures, the first picture shows the original layout (Question text to the side) and the second picture shows what I want to achieve (Question text to the top of the form box.
If anyone could give me a alter to the code that would be greatly appreciated!
Cheers
HNZ
I am really enjoying my time with concrete5. Just have a request to alter the original form block layout. Right now the form block text is to the side of the actual input field itself when I actually want the text to be on top.
I have added some pictures, the first picture shows the original layout (Question text to the side) and the second picture shows what I want to achieve (Question text to the top of the form box.
If anyone could give me a alter to the code that would be greatly appreciated!
Cheers
HNZ
You can either just change the CSS for the form in your own CSS file or you could create a custom template (seehttp://www.concrete5.org/documentation/general-topics/custom-templa...
Shouldn't I just modify the form cv? What type of code should I use. Those links dont really help sorry.
Never-mind, I found out what was the problem. You just had to add a <br> to some code in ajax_tableless_layout. I have a feeling it is the same with the regular form block.
The code originally looks like this:
To put the text on the top, the code should be like this:
I hope this will help somebody in the future.
Cheers
HemDog
The code originally looks like this:
<div class="fields">
<?php foreach ($questions as $question): ?>
<div class="field field-<?php echo $question['type']; ?>">
<label <?php echo $question['labelFor']; ?>>
<?php echo $question['question']; ?>
<?php if ($question['required']): ?>
<span class="required">(required)</span>
<?php endif; ?>
</label>
<?php echo $question['input']; ?>
</div>
<?php endforeach; ?>To put the text on the top, the code should be like this:
<div class="fields">
<?php foreach ($questions as $question): ?>
<div class="field field-<?php echo $question['type']; ?>">
<label <?php echo $question['labelFor']; ?>>
<?php echo $question['question']; ?>
<?php if ($question['required']): ?>
<span class="required">(required)</span>
<?php endif; ?>
</label>
<br>
<?php echo $question['input']; ?>
</div>
<?php endforeach; ?>I hope this will help somebody in the future.
Cheers
HemDog