Module:Navbar: Difference between revisions

Created page with "local p = {} local cfg = mw.loadData('Module:Navbar/configuration') local function get_title_arg(is_collapsible, template) local title_arg = 1 if is_collapsible then title_arg = 2 end if template then title_arg = 'template' end return title_arg end local function choose_links(template, args) -- The show table indicates the default displayed items. -- view, talk, edit, hist, move, watch -- TODO: Move to configuration. local show = {true, true, true, false, false..."
Talk link restored: when the template has no talk page, "t" opens a new-topic form instead of showing a red link
 
(2 intermediate revisions by 2 users not shown)
Line 59: Line 59:
end
end
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
-- No talk page yet: link to "new topic" instead of a red link (users can still start a discussion)
if talkpage ~= '' and not title.talkPageTitle.exists then
talkpage = 'Special:NewSection/' .. talkpage
end
-- TODO: Get link_descriptions and show into the configuration module.
-- TODO: Get link_descriptions and show into the configuration module.