How to Remove (view source, children)


I would like to ask you if there is a possibility to remove the highlighted features displayed in the screenshot attached?

how to

Thank you :slight_smile:

1 Like

Hi. I don’t have the answer but could you explain your use case and why you’re interested in removing them? Thx


Since the viewers of my wiki are not devs, they don’t need to have the option of “view source”, because it might be disrupting for them to see it and not knowing/understanding why it’s there.
Also, the “children” option is a functionality (in my case) that we don’t need it, since I have installed the navigation menu, where all users have access and can view at anytime the tree with all the pages and the subpages as well.
So, my main concern is that I don’t want my users to see/ have access to “functionalities” that maybe complicated and useless for them.

Many thanks!

You have 2 ways for this:

  • use an SSX object to apply CSS with "display: none; for your 2 entries:
#tmviewsource, ul.dropdown-menu li a[title=Children]  {
    display: none;

(you must check my CSS selector before to use it)

  • or modify this template:
    In example on my xwiki, I remove the menu entry to modify rights access on page (except for Admin user and a custom users group) with this piece of code:
#if ($xwiki.user.isUserInGroup('XWiki.XWikiEditxxx') || $hasAdmin) ##efface le menu ACL si admin ou Ă©diteurEffaceur
        shortcut.add("$services.localization.render('core.shortcuts.view.rights')",function() { var editRights = $('tmEditRights'); location.href= editRights ? editRights.href : "$xwiki.getURL($spacePreferencesDocumentReference, 'admin', 'category=1')";}, { 'type':'keypress', 'propagate':false, 'disable_in_input':true });

Pascal B

Note that the CSS solution is nicer in the sense that it’ll make upgrading XWiki simpler (no need to merge the template changes).

yes but SSX need to be modify probably in next xwiki version too. :slight_smile:
SSX is simpler but you can not enable the menu entry for custom groups.

Thank you both for your help.

Unfortunately, I am not a developer to fully understand what you mean, but I will ask from my colleagues to give me a hand on this and if “they” have some further questions on how to implement it, I will revert.