Module:Listbox: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
set categories from listing page if using single arg
(remove FSA and TFH from staging)
(set categories from listing page if using single arg)
Line 27: Line 27:
function Listbox:renderContent()
function Listbox:renderContent()
   local listing = Listing._parseListing( ((self.categories[1] == 'The Wind Waker' and self.categories[3] == 'Enemies') or (self.categories[1] == 'Hyrule Warriors' and self.categories[3] ~= 'Legend Mode Scenarios') or self.categories[1] == 'Breath of the Wild') and self.subject .. '/Staging' or self.subject )
   local listing = Listing._parseListing( ((self.categories[1] == 'The Wind Waker' and self.categories[3] == 'Enemies') or (self.categories[1] == 'Hyrule Warriors' and self.categories[3] ~= 'Legend Mode Scenarios') or self.categories[1] == 'Breath of the Wild') and self.subject .. '/Staging' or self.subject )
  -- If categories weren't set already (because caller used single arg), then use the ones parsed from the page.
  -- CODE SMELL: setting unrelated state. this only works because renderFooter is called after renderContent.
  if #self.categories == 0 then self.categories = listing.categories end


   local content = mw.html.create( 'table' )
   local content = mw.html.create( 'table' )
Line 65: Line 69:
   getParent = function() return {
   getParent = function() return {
     args = {
     args = {
       [1] = "The Legend of Zelda",
       [1] = "The Legend of Zelda Locations"
      [2] = "Locations"
     }
     }
   } end
   } end

Navigation menu