Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
new tab/button in monobook template
Avatar
windreiter #1
Member since Feb 2009 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: new tab/button in monobook template
Hi,

where can I define a new tab (button) in the monobook template like "discussion", Edit", etc.?
It should be visible for every user (also not logged in) and contain a "hard link".
I worked through "conext.php" and "main.php" but don't know where to edit...

Thanks in advance
Avatar
windreiter #2
Member since Feb 2009 · 13 posts
Group memberships: Members
Show profile · Link to this post
found it.

insert this in context.php
$monobook['content_actions']['yourID']['text'] = "yourtext";
$monobook['content_actions']['yourID']['href']= "http://www.yourli.nk";

above (after all other buttons)

/* Determine what will be listed on personal tools */

this will generate your link as a button (tab) right of the standard buttons.
This post was edited on 2009-02-20, 11:14 by windreiter.
SteRe #3
Member since Aug 2008 · 436 posts · Location: Markkleeberg (nahe Leipzig)
Group memberships: Members
Show profile · Link to this post
Hi, thanks for the advise. I got the new tab, but it does not wor like I wish.
I'd like the have a tab for ODT export, but I don't know to tell the wiki the correct link. Any idea?
Wissen heißt wissen, wo's steht :)
Vieles habe ich hier festgehalten: http://wiki.familie-riemer.net
chi #4
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
?do=export_odt at the end of the URL should do the trick.
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
SteRe #5
Member since Aug 2008 · 436 posts · Location: Markkleeberg (nahe Leipzig)
Group memberships: Members
Show profile · Link to this post
thanks. it works
Wissen heißt wissen, wo's steht :)
Vieles habe ich hier festgehalten: http://wiki.familie-riemer.net
Avatar
Nappalan #6
Member since Oct 2007 · 92 posts
Group memberships: Members
Show profile · Link to this post
Hi SteRE
is it possible to post this part of context.php here in this thread?
Because I don't understand how to insert the right link for odt export. I want to create 2 or 3 new tabs with Odt Export and Print Version and maybe Cite. The brackets, ID and Link are not really clear.
Thanks in advance.

Nappalan
Sprichwort aus der Mongolei: Wenn du für jemanden eine Lampe anzündest, wird es auch deinen Weg erhellen!
SteRe #7
Member since Aug 2008 · 436 posts · Location: Markkleeberg (nahe Leipzig)
Group memberships: Members
Show profile · Link to this post
Hi Nappalan,

sure. You open the context.php in Line 193 and insert the following code for ODT export:
    /*  Eigener Tab für ODT Export */
    $monobook['content_actions']['exportODT']['text'] = "Als ODT exportieren";
    $monobook['content_actions']['exportODT']['href']= "?do=export_odt";

The lines for a print button should look like this:
    /*  Eigener Tab für Druck */
    $monobook['content_actions']['drucken']['text'] = "Seite drucken";
    $monobook['content_actions']['drucken']['href']= "javascript:window.print()";

For cite I'm not shure, but it should look like this:
    /*  Eigener Tab für Cite */
    $monobook['content_actions']['permalink']['text'] = "Seite zitierten";
    $monobook['content_actions']['permalink']['href']= "?do=cite";

These new tabs where always shown to everybody. If you want to hide them using ACL you have to create them in a more complex way like the other tabs.

SteRe
Wissen heißt wissen, wo's steht :)
Vieles habe ich hier festgehalten: http://wiki.familie-riemer.net
Avatar
Nappalan #8
Member since Oct 2007 · 92 posts
Group memberships: Members
Show profile · Link to this post
Hi SteRe,

great job,

this idea works very good and without problems. I don't need to insert the odt syntax in the template of each namespace or in every existing page anymore. That's really a sense full help!

Only one Item must be changed for the proper use of cite:

    /*  Eigener Tab für Cite */
    $monobook['content_actions']['permalink']['text'] = "Seite zitieren";
    $monobook['content_actions']['permalink']['href']= "?&mbdo=cite";

Thanks a lot
Nappalan
Sprichwort aus der Mongolei: Wenn du für jemanden eine Lampe anzündest, wird es auch deinen Weg erhellen!
This post was edited on 2009-02-21, 23:26 by Nappalan.
Avatar
Nappalan #9
Member since Oct 2007 · 92 posts
Group memberships: Members
Show profile · Link to this post
Hi SteRe,

if I want to create a additional tab with a link to a existing page - for example "Quellenangabe" - inside of my DokuWiki!

I don't know the correct code for that Idea. Can you help me?

Maybe

/*  Eigener Tab für Quellenangabe */
    $monobook['content_actions']['??']['text'] = "Quellenangabe";
    $monobook['content_actions']['??']['href']= "wie wird der Link zur page quellen dargestellt";

Thanks in advance
Nappalan
Sprichwort aus der Mongolei: Wenn du für jemanden eine Lampe anzündest, wird es auch deinen Weg erhellen!
SteRe #10
Member since Aug 2008 · 436 posts · Location: Markkleeberg (nahe Leipzig)
Group memberships: Members
Show profile · Link to this post
Hello Everybody,

like I said last days, here a translation of my former post (was in german).

@Nappalan: Looks good. Here an explanation of the 3 lines:

1st line is only comment to show whats comming next :)
Line 2 and 3 create the new tab with different properties. A tab has at least 2 properties - a name (text) which will be shown in your wiki and a link target (href). I think more are possible, but i'm note sure.
When you define a new tab, you have to give it a unique ID - thats where you wrote '??'. Just try any name. If there should be a problem, you hit a reserved name - if so, try another one.

For property href you have to write your link target. In your example it could be "http://meinwiki.de/quellen". I am not sure, if you can use DokuWiki-Syntax for this url, but you are customizing a template, so you also can code the target absolute - any update of the template will cause to add this part again.

Greatings
SteRe
Wissen heißt wissen, wo's steht :)
Vieles habe ich hier festgehalten: http://wiki.familie-riemer.net
This post was edited on 2009-02-26, 09:50 by SteRe.
Avatar
Nappalan #11
Member since Oct 2007 · 92 posts
Group memberships: Members
Show profile · Link to this post
Hi SteRe,

again, many thanks, - the explanation about the tab creation is now clear and seems to be easy. Further possible adjustments are unknown at the moment but in future we will learn more about such subject - hopefully  ;-)

So , what I did is shown here:

    /*  Eigener Tab für Quellen */
    $monobook['content_actions']['quellenangabe']['text'] = "Quellenangabe";
    $monobook['content_actions']['quellenangabe']['href']= "http://www. domain .de/quellen";

All different Information sources are included in one page with the name quellen. This Page is included in a tab at the top tabs order of the monobook template.

Thanks !
Nappalan
Sprichwort aus der Mongolei: Wenn du für jemanden eine Lampe anzündest, wird es auch deinen Weg erhellen!
Avatar
ach (Administrator) #12
Member since May 2006 · 1904 posts · Location: Folkestone, UK
Group memberships: Administrators, Members, Super Mods, Wiki Managers
Show profile · Link to this post
In reply to post #10
Quote by SteRe on 2009-02-23, 23:56:
PS: sorry for german posting, but I know, Nappalan also speaks german.

All English speaking people searching for a similar solution won't be very pleased with this ignorant deed and unkind remark ...
Please try to stick to the thread's/forum's language next time.
SteRe #13
Member since Aug 2008 · 436 posts · Location: Markkleeberg (nahe Leipzig)
Group memberships: Members
Show profile · Link to this post
Sure. Ach, you're right. But it was a leack of time.....i will post it in english next days
[edit] done
Wissen heißt wissen, wo's steht :)
Vieles habe ich hier festgehalten: http://wiki.familie-riemer.net
This post was edited on 2009-02-26, 09:50 by SteRe.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-11-16, 21:19:43 (UTC +01:00)