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)
Teamsite preview mode - What to do with hidden elements..?
Amit_LnT
Hi,
I know that in the preview mode, TS does not run the Formapi. But i would like to know, if there is any way, we can restrict the hidden elements from display in the preview mode. Sorry, if a repeated post, i did not search it well..
ENV: TS 6.5 sp2, windows server 2003
thanks,
amit
Find more posts tagged with
Comments
nipper
How are you hiding the objects ? Via FormAPI or with the < hidden > construct ?
Amit_LnT
sorry Andy.. may be I confused here.. <hidden> elements work fine. I have hide few elements through formapi.
Is there anything that can be done for such elements?
My main problem came from Callserver. I have a field for which I call the server script through formapi and hence, it does not get call in preview mode.
So, I thought to change it to inline command.
Is there any workaround for that?
thanks,
amit
Migrateduser
The problem with preview is that it does not run formapi, so all your javascript does not get executed. I doubt that there is a fix for TS65 though.
nipper
I am confused Amit. You have a field that is filled by a callserver and showing up in preview mode ?
You certainly can use inlines (which are easier that callserver), the inline will only run on startup and not on a FormAPI event. If that is acceptable, you can change.
Now if you want to hide the value your inline can have some logic to hide or not the field.
Maybe you can completely describe your setup and desired behavior.
Andy
Amit_LnT
Hi Andy,
sorry for the late reply.. was tide up with something else..
I have changed that callserver to inline... this is safe for me..
But what I would like to know is that is there any workaround to not show the invisible elements in the view mode of DCT.
I have two content types in a DCT. Based on the selection of drop down, the fields are set visible/invisible using formapi. Now, reviewers have only read access to the system. And when they try to check the DCT in view mode, it does not run formapi and shows all the items present in the DCT, including the one which is not required. And that creates a confusion for them.
Is there any way I can hide the invisible items from display in View mode?
Thanks,
Amit
nipper
I have done this before. It worked great with 6.5 roles.
You can remove the setVisible from FormAPI and change the elements in question to an inline.
The script that is run is a perl script that builds the XML for the elements in question (or in my case builds eveything).
Get ther user name $ENV{IW_USER}
If the user is in the "list" do not wrap < hidden > tags around the elements in question.
Amit_LnT
Andy,
I am not sure, I understand this correct.
I need the visible/invisible beaviour as dynamic. So, if the user selects a different option in the content type field, it will display new set of fields for it.
Inline callout will only work once before the form load. And it will not give the hide/show feature as formapi. So, will not work as expected, if some users wants to edit the content.
Could you pl share some code snippet for the perl script you mentioned?
Also, if supposed I am successful in wrapping <hidden> around the non required items, next time if the content type drop down value changes, the DCT wont show that field.
I do not want to hide/delete a item permanently. It will be all user selection based.
nipper
You can't always get what you want.
This will allow you to hide/show fields based on the user or role. I do not know if you can read the DCR which this is running. I highly doubt it but that is possible.