Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Examples  














Module:Cslist






Azərbaycanca
تۆرکجه

Basa Banyumasan
Буряад
Cebuano
Español
فارسی
  / Gõychi Konknni

Bahasa Indonesia
Kurdî
Ladin

Монгол



ି
Oʻzbekcha / ўзбекча


Simple English
Slovenščina
کوردی
Српски / srpski
Tagalog
 

Tiếng Vit

 

Edit links
 









Module
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikispecies
Wikimania
Wikiversity
 
















Appearance
   

 





Permanently protected module

From Wikipedia, the free encyclopedia
 


Module to implement Template:Cslist, which creates a horizontal list similar to Template:Hlist but using comma separators instead of mid-dots.

It can take as many list items as desired, and also an optional |semi=, which when set to trueoryes will use a semicolon as separator in place of the comma.

Note: the unordered list which is generated is good for accessibility, but really is only useful in tables and infoboxes as an alternative to using {{hlist}}. It should not be used in running prose.

Examples

{{cslist | first item | second item | third item | etc}}
  • first item
  • second item
  • third item
  • etc
{{cslist | first item | second item | third item | etc |semi=true}}
  • first item
  • second item
  • third item
  • etc

p = {}

p.makelist = function(frame)
 local args = frame.args
 if not args[1] then
  args = frame:getParent().args
  if not args[1] then return end
 end
 local semi = (args.semi or ""):sub(1,1):lower()
 semi = (semi == "t") or (semi == "y")
 local embedded = (args.embedded or ""):sub(1,1):lower()
 embedded = (embedded == "y")
 local out = ""
 for k, v in ipairs(args) do
  v = mw.text.trim(v)
  if v ~= "" then
   out = out .. "<li>" .. v .. "</li>"
  end
 end
 local listclass = ""
 if semi then
  listclass = listclass .. "sslist"
 else
  listclass = listclass .. "cslist"
 end
 if embedded then
  listclass = listclass .. " cslist-embedded"
 end
 if out ~= "" then
  return '<ul class="'.. listclass ..'">' .. out .. '</ul>'
 end
end

return p

Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:Cslist&oldid=979066507"

Hidden category: 
Wikipedia semi-protected modules
 



This page was last edited on 18 September 2020, at 15:45 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki