cosmocode / dokuwiki-plugin-tabbox

Create tabbed boxes in DokuWiki
5 stars 2 forks source link

[SOLVED] Option to hide the "Edit" button? #21

Open richb-hanover opened 1 year ago

richb-hanover commented 1 year ago

The tabbox plugin works great - it does exactly what I want (see the tabbed box right below the router photo at https://openwrt.org/toh/netgear/wndr3700)

I want to use it with the wst Dokuwiki plugin to create a template that can be parameterized with the device name/model. This also works great.

But... The tabbox plugin puts an "Edit" button at its top-right corner. This, too, works great when the content of the tabbox is on the same page. But when it's being pulled from a (separate) template file, the editor gets the wrong text (see this video: https://youtu.be/s5Oym3_oYCs )

And this (attempting to edit the template from a "child page") is probably the "wrong thing to do". That template likely wants to remain static, and only editable from its own page.

Possible solutions:

  1. Tell my users not to click the Edit button
  2. Find a way to hide the "Edit" button \<== Solution found (below)
  3. Something else

Any thoughts on the second (or third) alternative? Many thanks.

richb-hanover commented 1 year ago

Answering my own question (with great assistance from the Dokuwiki forum: https://forum.dokuwiki.org/d/20448-create-my-own-variable/13)

The "Edit" button from a <tabbox> can be hidden if the "template" is wrapped in a <WRAP>. That is:

<WRAP>
<tabbox ...>

some interesting content with variable substitution like {{{1}}}

</tabbox>
</WRAP>
splitbrain commented 1 year ago

Maybe a $ID == $INFO['id'] check would work?

richb-hanover commented 1 year ago

That's interesting (that is, $ID == $INFO['id']). This clue might help others.

I was able to solve the problem for my template by putting the <tabbox> in a <WRAP> Thanks!