Module:Galbox: Difference between revisions

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 68: Line 68:
function Galbox:renderContent()
function Galbox: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


   -- test if there are no sections at all
   -- test if there are no sections at all
Line 116: Line 120:
   getParent = function() return {
   getParent = function() return {
     args = {
     args = {
       [1] = "The Legend of Zelda",
       [1] = "The Legend of Zelda Characters"
      [2] = "Characters",
     }
     }
   } end
   } end