Änderungen

Zur Navigation springen Zur Suche springen
keine Bearbeitungszusammenfassung
Zeile 18: Zeile 18:  
if Pagename == nil then return nil end
 
if Pagename == nil then return nil end
 
local returnString = ""
 
local returnString = ""
     local queryResult =  mw.smw.ask('[['..Pagename..']]|?Seitentyp|?Basistyp|?Hauptkategorie|?=#|mainlabel=-')
+
     local queryResult =  mw.smw.ask('[['..Pagename..']]|?Seitentyp|?Basistyp#|?Hauptkategorie#|?Eigenkategorie#')
 
     if queryResult == nil then return nil end
 
     if queryResult == nil then return nil end
 
     local Seitentyp = queryResult[1]['Seitentyp']
 
     local Seitentyp = queryResult[1]['Seitentyp']
    returnString = Seitentyp
  −
   
   
     local Basistyp = nil
 
     local Basistyp = nil
 
     if queryResult[1]['Basistyp'] ~= nil  
 
     if queryResult[1]['Basistyp'] ~= nil  
    then
+
    then
    Basistyp = queryResult[1]['Basistyp']
+
    Basistyp = queryResult[1]['Basistyp']
Basistyp = string.gsub(Basistyp, "%s+", "_")
+
Basistyp = string.gsub(Basistyp, "%s+", "_")
returnString = returnString .. Basistyp
+
    end
    end
   
 
 
local Hauptkategorie = nil
 
local Hauptkategorie = nil
Zeile 36: Zeile 33:  
Hauptkategorie = queryResult[1]['Hauptkategorie']
 
Hauptkategorie = queryResult[1]['Hauptkategorie']
 
Hauptkategorie = string.gsub(Hauptkategorie, "%s+", "_")
 
Hauptkategorie = string.gsub(Hauptkategorie, "%s+", "_")
returnString = returnString .. Hauptkategorie
+
end
 
+
 +
local Eigenkategorie = nil
 +
if queryResult[1]['Eigenkategorie'] ~= nil
 +
then
 +
Eigenkategorie = queryResult[1]['Eigenkategorie']
 +
Eigenkategorie = string.gsub(Eigenkategorie, "%s+", "_")
 
end
 
end
 
     --teste ob Seitentyp Kategorie
 
     --teste ob Seitentyp Kategorie
Zeile 45: Zeile 47:  
     local Vorlage = mw.title.new('Liste_'..Pagename, 'Vorlage' )
 
     local Vorlage = mw.title.new('Liste_'..Pagename, 'Vorlage' )
 
     -- wenn das der fall ist lade entsprechendes template
 
     -- wenn das der fall ist lade entsprechendes template
     if Vorlage.exists ~= nil
+
     if Vorlage.exists == true
 
     then  
 
     then  
 
     returnString = mw.getCurrentFrame():expandTemplate{title ="Liste_"..Pagename}  
 
     returnString = mw.getCurrentFrame():expandTemplate{title ="Liste_"..Pagename}  
Zeile 56: Zeile 58:  
     -- teste ob Liste_Basistyp vorhanden ist  
 
     -- teste ob Liste_Basistyp vorhanden ist  
 
     local Vorlage = mw.title.new('Liste_'..Basistyp, 'Vorlage' )
 
     local Vorlage = mw.title.new('Liste_'..Basistyp, 'Vorlage' )
     if Vorlage ~= nil
+
     if Vorlage.exists == true
 
     then
 
     then
 
     returnString = mw.getCurrentFrame():expandTemplate{title ="Liste_"..Basistyp}  
 
     returnString = mw.getCurrentFrame():expandTemplate{title ="Liste_"..Basistyp}  
     return Basistyp .. returnString
+
    returnString = mw.getCurrentFrame():callParserFunction{name='#invoke', args={'ListeBasistyp','Liste',Basistyp}}
 +
     return returnString
 
     end
 
     end
 
     end
 
     end
Zeile 65: Zeile 68:  
if Hauptkategorie ~= nil  
 
if Hauptkategorie ~= nil  
 
then
 
then
returnString = returnString .. Hauptkategorie
   
     local Vorlage = mw.title.new('Liste_'..Hauptkategorie, 'Vorlage' )
 
     local Vorlage = mw.title.new('Liste_'..Hauptkategorie, 'Vorlage' )
    returnString = returnString .. Vorlage
+
     if Vorlage.exists == true
     if Vorlage ~= nil
   
     then
 
     then
 
     returnString = mw.getCurrentFrame():expandTemplate{title ="Liste_"..Hauptkategorie}  
 
     returnString = mw.getCurrentFrame():expandTemplate{title ="Liste_"..Hauptkategorie}  
     return Hauptkategorie .. returnString
+
     --returnString = returnString .. mw.getCurrentFrame():callParserFunction{name='#invoke', args={'ListeBasistyp','Liste','Basistyp='..Basistyp}}
 +
    return returnString
 
     end
 
     end
 +
end
 +
--eigenkategorie (kann basistyp sein dann lieber invoke funktion )
 +
if Eigenkategorie ~= nil
 +
then
 +
    local Vorlage = mw.title.new('Liste_'..Eigenkategorie, 'Vorlage' )
 +
    if Vorlage.exists == true
 +
    then
 +
    if Eigenkategorie == "Basistyp"
 +
    then
 +
    returnString = mw.getCurrentFrame():callParserFunction{name='#invoke', args={'ListeBasistyp','Liste','Basistyp=Basistyp'}}
 +
    end
 +
 +
    returnString = mw.getCurrentFrame():expandTemplate{title ="Liste_"..Eigenkategorie}
 +
    return returnString
 +
    end
 
     end
 
     end
     return returnString
+
     return returnString ..mw.getCurrentFrame():expandTemplate{title ="Liste_GehörtZu"}
 
end
 
end
    
return p
 
return p

Navigationsmenü