Form Core Replacement

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
User avatar
santscho
Posts: 1442
Joined: Mon 2. Apr 2007, 08:56
Location: Schweiz

Form Core Replacement

Post by santscho »

Just completed the "content23" replacement (CP Form). The phpwcms generates now css instead of table based forms.

Download:
https://github.com/santscho/phpwcms-better-form

Features:
- Supports both layouts (a) label and field in one row and (b) label and field in separate rows
- Comes with the complete CSS for all form elements
- No classes need to be defined in the form CP
- CSS3 enhanced for better looking forms
- Separate containers for default/success/error message
- Form errors listed in <ul><li> instead </br>
- "Break" as horizontal text divider (fieldset replacement)
- "Break Text" can be used as sub divider
- Checkboxes and radiobuttons nicely displayed in all possible cases

Not done yet:
- Form behave when form built in custom mode
- CSS: Styling of the error list
- CSS: Styling of the default/success/error box
Schon Konfuzius sagte: "Sei kein YAML-Lappen". YAML-phpwcms-Integration auf http://www.yaml.phpwcms.org
User avatar
santscho
Posts: 1442
Joined: Mon 2. Apr 2007, 08:56
Location: Schweiz

Re: Form Core Replacement

Post by santscho »

For Testing just download from github. backup the original file. Integrate the CSS in your template (recommended to backup previous CSS and then delete all form classes before importing my classes). Finally, just create a basic dummy form without any classes.
Schon Konfuzius sagte: "Sei kein YAML-Lappen". YAML-phpwcms-Integration auf http://www.yaml.phpwcms.org
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Re: Form Core Replacement

Post by marcus@localhorst »

Hei,
thanks for the work. Sometimes I hacked the core too, but it gets ugly if a) the developer don't develop it any longer and b) the original files are updated by OG and a) happened.
I think the Form CP has great possibilities for custom forms, especially the render hooks/custom functions and stuff, so it is possible to use tableless forms. Also I would recommend to write frontend_render scripts to manipulate the DOM instead of hacking the corefiles (using phpQuery or something similar).
And last but not least - it's always possible to adapt a contentpart and transform it to a Module, which act like the original CP (incl own enhancements).

So using this hack, always depends on you as developer to keep it up to date and there are a lot of orphaned mods here for phpwcms, where nobody knows if they still work. I myself wrote stuff I don't rememeber anymore ^^.

This is just what I think and it's no offense ;-)

cheers marcus
User avatar
santscho
Posts: 1442
Joined: Mon 2. Apr 2007, 08:56
Location: Schweiz

Re: Form Core Replacement

Post by santscho »

Thanks Marcus for your input

I am in contact with Oliver. He will optimize my code and adapt it in the core of phpwcms.
Schon Konfuzius sagte: "Sei kein YAML-Lappen". YAML-phpwcms-Integration auf http://www.yaml.phpwcms.org
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Re: Form Core Replacement

Post by marcus@localhorst »

santscho wrote:Thanks Marcus for your input

I am in contact with Oliver. He will optimize my code and adapt it in the core of phpwcms.
That's much better :) cheeers
Post Reply