soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
315 stars 29 forks source link

Multiple oxygen templates for same post type, ACF dynamic field to select field which template to use #2485

Open wpsumo opened 3 years ago

wpsumo commented 3 years ago

Describe the feature you'd like to see included in Oxygen. It's very common we want different design on two different pages but we don't need or use a different CPT or post type. As it is right now in Oxygen we can only use one Oxygen template per post type. Or it's static so you have to select specific post IDs.

This is very limited, and I would like to see that we can assign two designed templates to a post type in oxygen templates, but on the edit page or post we can select which template to use for this specific page. This would solve many issues.

Right now we would need to bloat one template and make different design in one and the same and use conditions to output. This is not ideal and with the handling of template and conditions together with speed issues in Oxygen builder it's not suitable to go with this approach.

I believe using similarity to how wp native theme template works is ideal. But as a quick solution wouldn't it work to set 2 templates on the same post type. Then the template have a secondary condition which is use dynamic data and there we can select a field. This field is then an ACF select field created with ACF on the page. This select field contains template a and template b. In oxygen template we select to use this template if the ACF field is === template a. CleanShot 2021-10-24 at 18 44 02

So it would be conditions for oxygen templates here: What are the use cases for this feature? More flexibility, this would solve a major problem for me today, and it's not normal you want the same template and design just because it's the same post type.

Examples of this feature or functionality. Normally native wordpress themes you can create several of php templates for the same post type the user select which template to use in the drop down: https://developer.wordpress.org/themes/template-files-section/page-template-files/

You could add taxonomy to pages and cpt's and use this but it's just extra bloat register taxonomy to use as template reference, once we just want to use an simple acf select field. Why can't we just add another field to support dynamic data? Once this condition is true use this template instead of the other one. This would truly be amazing and solve many issues on our end and it makes oxygen template functionality more dynamic and less limiting and it feels pretty easy to implement?

Need to support array field like ACF Select field and not just static field values so we can build our ACF dynamic select template dropdown and populate template on pages and post based on dynamic field.

wpsumo commented 3 years ago

@KittenCodes @Spellhammer What do you think about this? :)