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  



Printable version
 




In other projects  



Wikispecies
Wikimania
Wikiversity
 
















Appearance
   

 





Permanently protected module

From Wikipedia, the free encyclopedia
 


This is an old revision of this page, as edited by RexxS (talk | contribs)at07:26, 18 August 2019 (removing entries from the list if they are empty). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff)  Previous revision | Latest revision (diff) | Newer revision  (diff)

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 out = ""
 for k, v in ipairs(args) do
  v = mw.text.trim(v)
  if v ~= "" then
   out = out .. "<li>" .. v .. "</li>"
  end
 end
 if out ~= "" then
  if semi then
   return '<ul class="sslist">' .. out .. '</ul>'
  else
   return '<ul class="cslist">' .. out .. '</ul>'
  end
 end
end

return p

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

Hidden category: 
Wikipedia semi-protected modules
 



This page was last edited on 18 August 2019, at 07:26 (UTC).

This version of the page has been revised. Besides normal editing, the reason for revision may have been that this version contains factual inaccuracies, vandalism, or material not compatible with the Creative Commons Attribution-ShareAlike License.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki