Перейти к содержанию

Модуль:CTD: различия между версиями

м
нет описания правки
мНет описания правки
мНет описания правки
Строка 43: Строка 43:




-- Create short description
-- Create short description without hyper links
-- Used in : Шаблон:Понятие БТС
-- Call example:
-- {{#invoke: CTD | shortly
--  | short_text = Short description, if exist
--  | long_text  = Long description
-- }}
function ctd.shortly( frame )
function ctd.shortly( frame )
local result = ''
local result = ''


-- check if sort description specified
-- check if sort description specified
if not isempty(frame.args['shortly']) then
if not isempty(frame.args['short_text']) then
result = frame.args['shortly']
result = frame.args['short_text']
else  
else  
result = frame.args['description']
result = frame.args['long_text']
-- keep only text before Category
-- keep only text before Category
local i = mw.ustring.find(result,'[[Категория',1,true)
local i = mw.ustring.find(result,'[[Категория',1,true)