Board Thread:Support Requests - Getting Technical/@comment-27729796-20190623165830

Hi! I'm trying to help a friend get navigational tabs working on their Wiki, based on something an ex-Wiki editors installed on another Wiki on which I'm an admin. Since the editor has left Wikia, I'm unable to ask him directly for advice anymore. Basically, This template invokes this module.

While I understand the code on a VERY surface level enough to adapt it to add new variables, I don't know enough to make it do exactly what we need.

Here is how I currently have it formatted:

-- local p = {} local title = mw.title.getCurrentTitle function section(html, text, link) local tag = html:tag('div') :addClass('article-tabs__tab') :wikitext( .. text .. ) if title.text == link then tag:addClass('article-tabs__selected') end tag:done end function p.main(frame) local args = frame:getParent.args local html = mw.html.create('div') :addClass('article-tabs') local text = title.rootText section(html, text, text) if args.page then section(html, 'Gallery', args.page .. '/Gallery') elseif args[1] == 'character' then section(html, 'Anime', text .. '/Anime') section(html, 'Manga', text .. '/Manga') section(html, 'Gallery', text .. '/Gallery') elseif args[1] == 'gallery' then section(html, 'Gallery', text .. '/Gallery') elseif args[1] == 'manga' then section(html, 'Gallery', text .. 'Riddle Story of Devil (Manga)/Gallery') elseif args[1] == 'koakuma' then section(html, 'Gallery', text .. 'Koakuma no Riddle/Gallery') end return tostring(html:done) end return p

What I would like the and  to do, is add a tab which just links to the page specified, rather than as a subpage. For example if you're on page "Chapter 01" the tabs would link to "Chapter 01" and "Riddle Story Of Devil (manga)/Gallery".

I would also like to only show navigation tabs for those listed, rather than link to the root page (ie, don't show a link to Joe Bloggs, but only show links to Joe Bloggs/Anime, Joe Bloggs/Manga and Joe Bloggs/Gallery), but this is not as high priority as the manga and koakuma variables.

If anyone is knowledgeable about how to alter this module to achieve this, particularly the |manga and |koakuma variables, I would really appreciate your help. Thanks in advance. 