This question about Topic Markup Language and applications: Answered
Reviewing pages elements (like topic actions) from page view
Hi,
Can some one please suggest me how can I remove, below highlighted contents from my
WebTopicList. If someone can just let me know from which file this information is coming , then I will be able to remove it from the file.
--
FahadOzair - 22 Jun 2021
Try thus adding the following topic preference (by going under "More topic actions" and then click button under "Edit topic preference settings"):
* Local SKIN = plain
--
LynnwoodBrown - 23 Jun 2021
Thanks for your reply Lynnwood.
I tried above steps but it actually removes left hand Menu Bar as well.
To be more specific, I want to display all the options for Admin User groups but for non Admin users , I just want them to see the left hand menu bar and the Page body but other options (highlighted in the above screen shot ) should not be visible to them.
I was thinking that in the file from which the above highlighted options are getting visible, there maybe I can put if condition and check for user , if user is admin then will display else will not display. If I get to know the corresponding files then I will be able to put If condition based on user group.
--
FahadOzair - 23 Jun 2021
Fahad - In order to do what you are wanting, you'll need to create a custom skin or at least a custom view template. That process is a bit more involved then I can outline simply here but I'll try to point you in the right direction.
The place to start is to familiarize yourself with the structure of Foswiki skin template. You can find that documentation in
SkinTemplates.
If you want to make this change to only a single (or few topics), then you can create a custom "view template" and assign it to the topic by setting
VIEW_TEMPLATE
preference in that topic. The way foswiki skins and view templates work, you can specify the "parent" template from which you will inherit all page components and then over-ride only the parts you to change. To do this, the first line in your view template will be
%TMPL:INCLUDE{"view"}%
which will automatically pull in all the components of the basic "view" template components from the selected skin on your site (which I'll assume is
PatternSkin).
Then you want to look at that parent template (in this case it would be
view.pattern.tmpl
in the template directory of your installation directory) and look for the sections you want to modify. From what you've said, the likely candidates would be
topicactions
&
top
(which contains the
breadcrumbs
and
top:toolbarbuttons
.
To override these sections, you'll add a
TMPL:DEF
in your view template for each of them with you new definitions.
The last key piece of information in achieving what you mention about admin users, is that you will use the "Conditional expansion" template format with the context identifier
isadmin
. Here is one example of what you will have that hopefully will get you started:
%TMPL:DEF{"top"}%TMPL:END%
Good luck!
--
LynnwoodBrown - 23 Jun 2021
Thanks a lot Lynnwood for your detailed solution.I will surely try to implement as suggested. Will get back to you in case any further help/information is required :-).
--
FahadOzair - 25 Jun 2021
I tried adding below but it gives me output as "}%
%TMPL:DEF{"topicactionbuttons"}%%TMPL:P{context="isadmin" then="%TMPL:PREV%"}%%TMPL:END%
I am trying to use condition that if admin has logged in then "topicactionbuttons" should be displayed otherwise it should be blank.
Can someone please let me know if there is some syntax issue.
Please edit this page to see the actual line added in my .tmpl file. Somehow it seems it is executing some parts of the lines while saving the comments.
--
FahadOzair - 17 Jul 2021
I'm sorry, there was a typo in the syntax I gave you. If you notice I left out a percent sign before the final
TMPL:END
. So it should have been
%TMPL:DEF{"top"}%%TMPL:P{context="isadmin" then="%TMPL:PREV%"}%%TMPL:END%
That being said, I don't see any issue with the syntax you said you used. I would just double and triple check you syntax. Also double check the
topicactionbuttons
template definition that gets loaded as "PREV" version to make sure it doesn't have a syntax error. I think you're on the right track and just just about have it.
--
Main.LynnwoodBrown - 17 Jul 2021
Thanks Lynnwood for your Help, I was able to implement it based on your suggestion and this support question can be resolved.
--
FahadOzair - 18 Jul 2021