[question/suggestion] Save page options with builder save template
I added custom page options to page edit screen and they work fine but it would be great if Save template in builder would save all set options on page edit including selected template or any options that the page had instead just saving the builder layout.
Extending on this thought, and bringing something from my wishlist, there should be two ways of importing a template:
- replace content (yes, including page options)
- append to content (just add the new sections at the end)
@moldcraft can we get this looked at when you have time? It would be great if we can get this in. Just plain example , you have a homepage template for builder but in page options you have page title disabled and full width page template selected or any other special options that you have setup for the homepage. None of those are imported for the user when he picks the home template , instead we have to instruct them what additional options to enable , disable etc. This kinda partially kills the purpose of save/use template.
- How will you specify which post options should be included in template?
- What if the user just wan't to play with the builder templates without losing current post options values?
- How will you specify which post options should be included in template?
Options could accept an attribute, like for example in_template, to determine what template group it should be linked to, to then be displayed and controled as separate groups similar to how Full Templates, Sections, Columns appear as separate types in page builder templates.
'option' => array(
'type' => 'text',
'in_template' => array( 'footer' ),
)
Somewhere, we could specify what "template groups" are available, for example with a $templates variable in options/posts/{$post_type}.php:
$templates = array(
'footer' => __('Footer', 'fw')
);
or in $cfg in theme/config.php:
'templates:posts:{$post_type}' => array(
'footer' => __('Footer', 'fw')
),
The interface to manage these templates would be the same used in page builder templates, it could appear at the top right of the main fw_options metabox in post edit screen (at the right side of tabs).
- What if the user just wan't to play with the builder templates without losing current post options values?
The most user intuitive solution would be to use undo/redo, and have that affect all fw_options Or, a "snapshot" could be done before changing to a new template, and allowing a roll back. Or simply it should be the user's responsability to create template as backup before changing anything.
If this went on, we could have it work for theme settings, term-meta and customizer options too, we would need a way to locate the interface to manage templates for a specific group, where we wanted, maybe by having a new option-type.
'footer_templates' => array(
'type' => 'template-manager',
'for' => array( 'footer' ),
),
This way, we could manage templates of, let's say a footer group, and have the interface located in the same box or popup as the rest of footer options that it controls (or somewhere else).
Or even, existing option containers could accept parameters, like for_template, and integrate the manager in a corner of the box, popup, etc.
'footer_box' => array(
'type' => 'box',
'for_template' => array( 'footer' ),
'options' => array(
'text' => array(
'type' => 'text',
'in_template' => array( 'footer' ),
),
),
),
Plus, if the interface allowed us to import/export the saved templates as text files, that would be :1st_place_medal:
Just bouncing ideas around :)
or add save page template and collect complete page setup without restrictions
