Difference between revisions 21306634 and 21306635 on frwiktionary

local export = {}

local m_submodule = nil

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
	if mw.title.getCurrentTitle().nsText == "Template" then
(contracted; show full)			table.insert(categories, "[[" .. parent.name .. "|" .. parent.sort .. "]]")
		else
			local parent_name = parent.name:getCategoryName()
			table.insert(categories, "[[Category:" .. parent_name .. "|" .. parent.sort .. "]]")
		end
	end
	

	if info.code then
		-- Also put the category in its corresponding "umbrella" or "by language" category.
			local umbrella = m_submodule.new(info):getUmbrella()
		
		
	

	if umbrella then
				local current_name = m_submodule.new(info):getCategoryName()
				table.insert(categories, "[[Category:" .. umbrella:getCategoryName() .. "|" .. current_name .. "]]")
		end
	end
end

-- Show navigational "breadcrumbs" at the top of the page.
function show_breadcrumbs(info)
	local steps = {}
	
	-- Start at the current label and move our way up the "chain" from child to parent, until we can't go further.
(contracted; show full)			return mw.getCurrentFrame():expandTemplate{title = TOC_template.text, args = {}}
		end
	end
	
	return nil
end

return export