Is there a workaround in php mode for accessing wappler SC & AC actions and control conditional rendering elements?
For example:
html elements here
<?php } ?>
Is there a workaround in php mode for accessing wappler SC & AC actions and control conditional rendering elements?
For example:
html elements here
<?php } ?>
I may be missing the whole goal here, but why not just use the show/hide dynamic attribute?
What I dont like is that with show/hide or with conditional regions it generate empty divs on the source view in browser. I dont know if this affect the site ??
The divs are shown in source but if using conditional regions are not rendered into the DOM
Shouldn't effect your site at all for any reason I am aware of? What is your concern?
Is not functions concern. Is more like looks amateur for me. But if this is the only way it work I will use it. I try to make source code as clean as possible.
Basically, thats how html works.
When I use this on dreamweaver, it dont render if the condition is not true. Even on source code I thought this can be achieved on Wappler.
Thanks for your patience.
You could try php includes inside conditional regions
But includes cant be conditional if you dont put inside a conditional region that is the same as direct conditional region.
My problem is that I have conditionals region inside a repeat region. So for each item in array generates the 9 conditional regions, even if the condition is not met.
What is going on in that page for so many duplicates of the same Conditions?
I have a database query where is storaged the condition that need to render if the case is true. (id-module)
So the query has a repeat region and inside the repeat region are the 9 conditional regions.
Repeat region item 1
---->Conditional 1
---->Conditional 2
---->Conditional 3
---->Conditional 4
---->Conditional 5
Repeat region item 2
---->Conditional 1
---->Conditional 2
---->Conditional 3
---->Conditional 4
---->Conditional 5
ETC...
I hope this explains better. I dont know that if this is the best approach?
Thatks exactly the point I want to avoid having too many empty conditional divs.
Surely nested repeats within the Server Action itself (based on a Condition server side) would be far better and more efficient? That way only what exists will be rendered or sent to the browser... Rather than using multiple repeating Conditions Client side?
But how do you tell the browser to render a div without a conditional region??
I want to do exactly what you are telling me but I am a little lost dont get it work.
Do all the work on the server in the Action before sending it to the Client/browser.
You have a table that is related to the item/property that contains its modules permission, is that a correct assumption?
Simple if it has results show it, if not hide it. Or a Condition if count => 1 etc. As each repeat within the nested query will be an array of results, either with or without results, and each can be handled according to the result.
I have a table that contains the modules in the order that need to be displayed in each page.
example:
Page 1
-----> Gallery
-----> Intro
-----> Item description
-----> Gallery
Page 2
-----> Intro
-----> Item description
-----> Two columns text.
I use the Browser Component URL to get the array from database. I am trying to create a CMS based on predefined modules.
I'd suggest using a nested query on the server side with a little logic and experimentation and then only return results you need. Nested queries can be powerful and very useful for scenarios like this. Have you investigated their usage? Example in the documentation.
Item/page table:
Module 1 - 0/1
Module 2 - 0/1
Etc.
Try to simplify your logic. Will make your life a lot easier if you need to expand upon it in the future. Otherwise you'll end up having to change things within the page every time you wish to include a new module... It is only my suggestion.