17488 Posts in 4473 Topics by 1978 members
|Go to End|
27 April 2008 at 11:42pm
I can see what you had in mind with the FormHolder function but I don't think injecting predetermined html into a form without the user specifying it is a good idea.
Prior to SS I had done some sites with Code Igniter which was/is a great framework to use. I found the process of creating forms (which I normally loath) very easy and natural.
Personally I think you should ditch the auto injecting of html and let the developer do a little bit more leg work to customise the form to how they want it. There is also extra html in there that doesn't really need to be there if the developers CSS skills are up to scratch.
By removing the "field" & "$Type" call we could rely on the $extraClass or shorten to $Class which should be more than enough. Also remove $titleBlock and let the user specify this with a new LabelField directly above the field insert or where they need it separating it from the field. Totally scrap the wrapping span as it would not be needed and once again separating $rightTitleBlock & $messageBlock.
Anyway...nothing major. Just a thought.
28 April 2008 at 9:06am Last edited: 28 April 2008 9:08am
If you want to change the way a form renders by default, just take Form.ss from sapphire, put it into your own "Includes" directory for your templates, then change it.
Then, you've got freedom to do things like:
<% control Fields %>
<div class="fieldHolder" id="$Name">
<% end_control %>
<% control Actions %>
<% end_control %>
There's also more functions to use in Form, I think you can also select each individual field as well - that way, you don't have to use LabelField and LiteralField in your code, which shouldn't be in there anyway!
28 April 2008 at 10:03am
Thanks for the pointers Sean.
That sounds like a better solution.
|Go to Top|