Collapse sections based on resource
I have 2 resources that use the same model, but on one of them i need to open the form with some collapsed sections, how can i check wich resource is opening the form so i can make collapse true?
6 Replies
Since you have two resources, which are separate classes, why do you need a check?
i dont want to duplicate the form on both places,
the second one will have parts of the first form but collapsed, then i have a custom view that adds some stuff bellow the form
but the user can click to open the sections
right now i have the form duplicated but everytime i need to change something on the form need to do it in both places, if i can make a function to check wich resource is opening the form i can make the collapsed dynamic and use the same form for both
I don't think there is a way to check the resource. You could check the page you are on. I can only think about identifiying the resource via the URL
Maybe this:
This should work if you have separate pages for both and are not trying to reuse pages aswell π
perfect i think its this
let me check
Thanks a lot @pboivin its working