Module:ElementNavigation: Difference between revisions
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Line 204: | Line 204: | ||
table.insert(output, '<div class="element-navigation-container">') | table.insert(output, '<div class="element-navigation-container">') | ||
-- Add previous link | |||
if prevPage then | if prevPage then | ||
-- Get URL using MediaWiki's title object | |||
local prevUrl = mw.title.new(prevPage).fullUrl | |||
table.insert(output, string.format( | table.insert(output, string.format( | ||
'<div class="element-navigation-prev"> | '<a href="%s" class="element-navigation-link"><div class="element-navigation-prev">%s</div></a>', | ||
prevUrl, prevLabel | |||
)) | )) | ||
else | else | ||
| Line 218: | Line 220: | ||
if nextPage then | if nextPage then | ||
-- Get URL using MediaWiki's title object | |||
local nextUrl = mw.title.new(nextPage).fullUrl | |||
table.insert(output, string.format( | table.insert(output, string.format( | ||
'<div class="element-navigation-next"> | '<a href="%s" class="element-navigation-link"><div class="element-navigation-next">%s</div></a>', | ||
nextUrl, nextLabel | |||
)) | )) | ||
else | else | ||