How to duplicate a form block for different styles?

Permalink
I am using Concrete5 v.5.5.1. I would like to duplicate a form block to have the form displayed in 2 different styles. The current form block has <table>, <label> and <input> tags within controller.php file. That means I cannot create custom templates (or can I?).

I want 2 styles of forms within the website I am building. If I can duplicate the form block, this can be easily done but I'm not sure how to duplicate the form block so that I can choose between 2 form blocks to add to any page.

Thanks

BlueFractals
 
jero replied on at Permalink Best Answer Reply
jero
Good point. The controller does some of the code that one might expect to be in the view. However, it seems quite easy to work it back a step. I came up with this alternate view, which looks identical to the original:

<?php
defined('C5_EXECUTE') or die("Access Denied.");
$survey = $controller;
$miniSurvey = new MiniSurvey($b);
$miniSurvey->frontEndMode = true;
?>
<a name="<?php echo $survey->questionSetId ?>"></a><br/>
<?php if ($invalidIP) { ?>
    <div class="ccm-error"><p><?php echo $invalidIP ?></p></div>
<?php } ?>
<form enctype="multipart/form-data" id="miniSurveyView<?php echo intval($bID) ?>" class="miniSurveyView" method="post" action="<?php echo $this->action('submit_form') . '#' . $survey->questionSetId ?>">
    <?php if ($_GET['surveySuccess'] && $_GET['qsid'] == intval($survey->questionSetId)) { ?>
        <div id="msg"><?php echo $survey->thankyouMsg ?></div> 
    <?php } elseif (strlen($formResponse)) { ?>
        <div id="msg">


Seems to work and submit OK, including the CAPTCHA thingy. Now of course customise it as you see fit.
malkau replied on at Permalink Reply
malkau
I always use the "Form Tableless Layout" addon which gives you a completely CSS output of the core form block.
http://www.concrete5.org/marketplace/addons/form-tableless-layout/...

It's actually simply a custom template for the form block. I then actually just take a copy of the template and modify it further if I need any special DIVs or CSS.