Open zuroma999 opened 3 years ago
@zuroma999 Can you use Oxygen's Conditions feature for this?
@zuroma999 Can you use Oxygen's Conditions feature for this?
Thanks for the reply. We currently do, but for some areas, we have a chain of 24 nested divs with conditions on them. Having all the logic in one of our custom shortcodes, returning a rendered re-reusable part, would be so much cleaner and faster.
@zuroma999 Have you tried packaging your more complex logic up into custom conditions?
I think from your description it would make more sense.
Instead of having 24 nested divs, you could have one function with all of the logic that determines whether true or false should be returned based on whatever you want.
@zuroma999 Have you tried packaging your more complex logic up into custom conditions?
Thanks for the reply. We do use custom conditions, but the condition testing isn't the issue, it's that each test needs to show a different div.
For eg: if not logged in, show a div. If logged in show another div. If purchased access, show a div. If not purchased access show another div, etc.
It would be so much cleaner if Oxygen had IF/ELSE support (a compound element with two divs, where if the condition is true it shows the first div, otherwise it shows the second div).
Or, if Oxygen had full support for rendering reusable parts via shortcode, then one of our custom shortcodes could be dropped into the page, and it would do all the tests at once and just return the appropriate Oxygen reusable part.
Oxygen is still the best builder for our needs, but we just wish it was more developer friendly. We aren't an agency, but a mid-size company with a single website on a heavily custom-coded WordPress install. As more of our business shifted online, we sought to speed up our pages and chose Oxygen. If only Oxygen did what some other builders did, it would be perfect:
Being able to properly display a reusable part via shortcode, so that all the class and ID-attached styles properly render.
Every other page builder we've used supports this.
There are countless times, for complex logic, it makes more sense to move condition testing to a PHP code block that can display the necessary reusable parts via shortcode.
As an example, this is what we currently do in Elementor, with the following pseudo-code: