Module:CRTModel: Difference between revisions
No edit summary |
No edit summary |
||
| Line 273: | Line 273: | ||
linkTarget = tostring(mw.uri.fullUrl('File:' .. filename)) | linkTarget = tostring(mw.uri.fullUrl('File:' .. filename)) | ||
end | end | ||
-- Always link to the wiki page | |||
local docPageName = trim(cells[1]) | |||
if | if docPageName then | ||
-- Determine display text priority: custom title > type | -- Determine display text priority: custom title > type | ||
local displayText = 'Document' | local displayText = 'Document' | ||
| Line 283: | Line 286: | ||
end | end | ||
-- Create list item with link | -- Create list item with link to wiki page | ||
local li = ul:tag('li') | local li = ul:tag('li') | ||
li:wikitext('[' .. | li:wikitext('[[' .. docPageName .. '|' .. displayText .. ']]') | ||
end | end | ||
end | end | ||