Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Show/hide form element based on config file?
steveblunden
Hi,
I'm fairly new to templating so forgive me if this is a stupid question.
I would like to show or hide a specific element on a datacapture form, based on whether the current branch name is specified in a list (text file / xml file stored somewhere in the backing store).
I know I can do this for a specific user, by using group membership, but what I need to do is show or hide this dependng on the branch name.
Any assistance or examples would be much appreciated. Im using TeamSite 6.7.2 SP2.
Thanks, Steve
Find more posts tagged with
Comments
Migrateduser
You can store your branch names in a .js file and assign them to an array. Include that js file into your DCT and you can then use those values.
You can also use ajax to call your web accessable properties, xml or html file and read in the contents.
You could bring in the list of "branches" from a txt file by using an inline command on a hidden field. You can then use FormAPI to get the values from that field so that you can use them to hide your other field(s) using setVisible.
nipper
The previous suggestions were the hard way, if you are OK with Perl.
Make your DCT one big inline, which runs a perl script.
By placing the Perl script outside the branch, you can share that DCT over hundreds of branches. You can put logic in there to hide fields from certian users, on certain branches, etc.
I did a GearUp (TeamSite Forms Publisher Best Practices) presentation a couple years ago on this, you can search for it or email me and I will send a copy.
The big difference is this is executed before the form in initialized so there is a little work in the beginning and nothing after. Doing it in FormAPI (with JS) takes *significantly* longer to load while the user is waiting. And still you need a Perl call server to read the config file.