Styling the form block (custom template)
Permalinkconcrete>core>controllers>form_minisurvey.php (inside of the loadSurvey method)
However, if I change this then all the other forms in my site will be styled the same way?
Is there something I'm missing here?
I have a "controller" folder outside of the concrete folder, but I don't have a "core" folder.
form_minisurvey.php is in
concrete>core>controllers>form_minisurvey.php
Does this mean I can't / am not supposed to override the file?
I get how to override concrete controllers but this file is in concrete> core > controllers NOT concrete > controllers (generally if I want to override a concrete controller I just make a copy in my controllers folder, right?)
SO, do I just create a core folder, put "controllers" in the "core" folder, and put my form_minisurvey.php controller class there?
If you copy the form block controller as described above then it should be sufficient as that controller extends the *core->controllers->mini_formsurvey* controller so you can override the methods you need in that file
Also I had to disable the "Overrides Cache", looks like there was an identical question here (duh)
http://www.concrete5.org/community/forums/customizing_c5/override-c...
if($this->get('surveyName')!='Whatever name you use')
I think it's because $this is the MiniSurvey class, *not* the FormBlock controller class?
This in fact makes life a bit easier, as you can do the following instead of the previous method:
1) In /models create a new class (call it what you like) e.g. custom_mini_survey.php, do this in that class:
<?php class CustomMiniSurvey extends Concrete5_Controller_Block_FormMinisurvey { }
Within that extend the loadSurvey method as needed (no need for the block name checking anymore).
2) Create a custom view template for your form in /blocks/forms/templates
Copy the /concrete/blocks/form/view.php file as a starting point, but make sure you rename it to something else e.g custom_view.php
3) At the top of your custom view, change
$miniSurvey=new MiniSurvey($b);
to
$miniSurvey=new CustomMiniSurvey($b);
4) Set the form to use the Custom View template
This should work (untested but seems logical) and if the custom view doesn't recognise the CustomMiniSurvey class you might have to load it at the top of your view template using Loader::model('custom_mini_survey')
http://www.concrete5.org/marketplace/addons/form-tableless-layout/...
I keep forgetting how styling the form block is different from the other blocks...is this getting changed at any point?
For the addon, I have one question, can I use more than one custom template?
And yes, you can have as many custom templates as you want. Just create more files in the /blocks/form/templates directory (and choose between them by clicking on the block while in edit mode and choosing "Custom Template" from the popup menu.
-Jordan
Copy the methods you want to override from concrete/core/controllers/blocks/form_minisurvey.php into your class
This will mean that all your blocks will use the markup generated by your new methods.
If you want to use the default styling on all forms except for this one then you can always give a block a particular name (using the "Form Name" attribute under "Options") when adding the form and then add a check at the top of your override method so for example if you were overriding the loadSurvey method you might have something like this: