Page include passing parameter to condition a collapsible wrapper

  • 1
  • Question
  • Updated 2 years ago
  • Answered
  • (Edited)
I have a page include which has a query string Add=Add


In the included page I have conditioned the wrapper to show if the Page/URL is NOT EQUAL to Add

I assume this should work.  Any ideas?
 
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Try:
&Add=Add
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
 I read somewhere that the & is not needed as Skuid will add to the string.  I did try it and it still does not work.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Page include parameters don't work for anything in the included page except for model conditions. You'll have use a model to capture it and subsequently do something with the model in order to get it to conditional rendering.

Easy way... Create a model that returns a row to any object. The the condition to abort if nothing provided. Then set a parameter that will always return a row on query. Ie. id <> url parameter "Add"

If model has no rows is our render condition.
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Thanks Pat.  I have tried to do what you said but I failed.  Can I use the one record that I always load which has 1 record and put a UI_Filed on that record.  But how do I get the variable into that UI_Field?
https://drive.google.com/file/d/0B409lhd9sYDcMDQyVVZURkFtdGs/view
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
It could be done, but it requires a bit of javascript.

The method I provided should have worked?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I see what you're doing. You need to create another model just for the purpose of conditionally rendering your collapsible wrapper. Call the model "CondRendCollWrap". Then setup the condition the same way as the video provided.

Then set the conditional rendering of the target collapsible wrapper to render when the "CondRendCollWrap" model has rows.
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Thanks Pat.  I have included a video recipe for others to see your solution.
https://drive.google.com/file/d/0B409lhd9sYDcWEZEN1JKazdEaTQ/view