This question about Configuration: Answered

Hide Javascript from Users

Hi everyone,

I added some javascript to a topic using the ADDTOZONE macro.

Now I am wondering if it is possible to hide this code from other Users, or should I place it somewhere else?

I need to react on events occurring inside the topic.

I hope this question is not too stupid and that there is a solution, because i do not want to confuse the normal user with javascript if he only wants to edit some text.

Happy New Year

Kilian


You can handle requirements like this using a View Template. See /System.PatternSkinCustomization#The_topic_template_approach_40using_VIEW_TEMPLATE_41. You can set the view template in the individual topic or web depending on requirements. If you don't want the set to clutter the edit, use the More topic actions link to set it in the topic settings. If the topic has a form attached, you can also use the AutoViewTemplatePlugin to associate a custom view template with any topic using the form.

-- GeorgeClark - 03 Jan 2012


Hi George,

Thank you for the fast answer. I managed to hide the script the first way you suggested. The RENDERZONE macro still remains, but I think this is inevitable and its is okay for me.

But I have one more follow up question:

Is it possible to have some text (headings) in a topic, which users can see when editing but cant edit/delete?

I want to create a type of topics which content is divided into two sections and users should be able to edit the content of the sections but not the headings.

When I put the headings in the viewtemplate they cant be seen when editing. When I put them in the edittemplate they are editable.

Regards Kilian


Kilian, Not anyway that I can think of off hand - but there are others better at this. If you don't get more answers here you could stop in on the #foswiki channel on IRC. Sometimes it's easier to explain what you want in a q&a format.

-- GeorgeClark - 11 Jan 2012


Hi George,

thanks again. I set the status of this question to "Answered", because the original question was answered.

Kilian

QuestionForm edit

Subject Configuration
Extension
Version Foswiki 1.1.3
Status Answered
Related Topics
Topic revision: r5 - 21 Jan 2012, KilLer
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy