Module:Navbar: Difference between revisions
Hide the "t" (talk) link by default – template talk pages are not used on this wiki, so the link was always red |
Talk link restored: when the template has no talk page, "t" opens a new-topic form instead of showing a red link |
||
| Line 13: | Line 13: | ||
-- view, talk, edit, hist, move, watch | -- view, talk, edit, hist, move, watch | ||
-- TODO: Move to configuration. | -- TODO: Move to configuration. | ||
local show = {true, | local show = {true, true, true, false, false, false} | ||
if template then | if template then | ||
show[2] = false | show[2] = false | ||
| 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. | ||