phproad / phpr-framework

[PHPR Framework] PHPRoad system files
http://phproad.com
MIT License
12 stars 2 forks source link

Form Preview Enhancements #26

Open patrickheeney opened 11 years ago

patrickheeney commented 11 years ago

Right now the preview layout is pretty static. We can choose left or right which works in some cases but not all. We should brainstorm on what we can do here since I had to result to hardcoding to pull this off. For example here is the existing preview layout:

screen shot 2013-09-21 at 3 09 29 pm

Here is what I ended up hardcoding to have it do:

screen shot 2013-09-21 at 3 09 36 pm

Perhaps we can have it pass additional settings to a partial. For example $this->add_form_field('city', 'left'); could be $this->add_form_field('city')->formAttributes(array('column' => 1, 'live_edit' => true)); and create a custom partial at some point that that would loop through and pull all the fields with attribute column 1.

Its important to note that this preview layout was only necessary for the /preview/ page and not the preview that happens when you click onPreviewPopup. So perhaps we can use the $context more intelligently and provide /preview/ -> $context = 'preview' and onPreviewPopup -> $context = 'preview_popup';

EHLOVader commented 11 years ago

A more complex grid structure shouldn't be too complicated to implement for this.

Although then you may need more field_definitions simply for structure, like containers, or clear blocks.

Looking through your layouts again, I wanted to know what sort of custom thing you did.. is it grid like or newspaper column like in the form build out?

grid

- - -
  /
- - -
  /
- - -

newspaper

-  -  -
-/ - /-
-  -  -