Zum Inhalt springen

Modulentwicklung Dateien: Unterschied zwischen den Versionen

Aus Computech CMS Wiki
Stefan.thalmann (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Stefan.thalmann (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Zeile 4: Zeile 4:
   Grund: '''YAML Spezifikation''' ([http://yaml.org/spec/1.2/spec.html])
   Grund: '''YAML Spezifikation''' ([http://yaml.org/spec/1.2/spec.html])


"Tabs have been outlawed since they are treated differently by different editors and tools. And since indentation is so critical to proper interpretation of YAML, this issue is just too tricky to even attempt. Indeed Guido van Rossum of Python has acknowledged that allowing TABs in Python source is a headache for many people and that were he to design Python again, he would forbid them.|YAML.org (Zitat: [http://www.yaml.org/faq.html FAQ], Nr. 2.)"
* Zitat aus FAQ: "Tabs have been outlawed since they are treated differently by different editors and tools. And since indentation is so critical to proper interpretation of YAML, this issue is just too tricky to even attempt. Indeed Guido van Rossum of Python has acknowledged that allowing TABs in Python source is a headache for many people and that were he to design Python again, he would forbid them.|YAML.org (Zitat: [http://www.yaml.org/faq.html FAQ], Nr. 2.)"


* [http://cgit.drupalcode.org/examples/tree/?h=8.x-1.x Link zu diversen Beispieldateien bzw. Skeletons]
* Link zu [http://cgit.drupalcode.org/examples/tree/?h=8.x-1.x Skeleton-Dateien für Drupal-Module]




Zeile 71: Zeile 71:
   global-styling:
   global-styling:
     version: 1.x
     version: 1.x
css:
      css:
  theme:
        theme:
    css/slider.css: {}
          css/slider.css: {}
fonts/css/font-awesome.css: {}
          fonts/css/font-awesome.css: {}
...usw...
          ...usw...

Version vom 12. Januar 2017, 12:43 Uhr

Dateien

  • Wichtiger Hinweis: Einrückungen innerhalb von yml-Dateien NUR MIT [Whitespace] realisieren!
 Grund: YAML Spezifikation ([1])
  • Zitat aus FAQ: "Tabs have been outlawed since they are treated differently by different editors and tools. And since indentation is so critical to proper interpretation of YAML, this issue is just too tricky to even attempt. Indeed Guido van Rossum of Python has acknowledged that allowing TABs in Python source is a headache for many people and that were he to design Python again, he would forbid them.|YAML.org (Zitat: FAQ, Nr. 2.)"


[modulname].info.yml =

Bermerkung: zwingend notwendig Kurzbeschreibung: Moduldefinition

 name: [Modulname]
 type: module
 description: [Modul-Beschreibung]
 package: [Package-Name z.B. zeberliEDV]
 core: 8.x
  • Optional: Abhängigkeiten deklarieren (Beispiel: Versionsabhängigkeit, Modul-Abhängigkeiten)
 version: 8.x-1.x
 dependencies:
 - block
 - examples
 - node
 
 
  • Optional: Regions deklarieren (Beispiel)
 regions:
   header: 'Header'

navigation: 'Menu' slider: 'Slider' highlighted: 'hilighted' content: 'Content' sidebar_first: 'Links sidebar' ...usw...

[modulname].routing.yml

Bemerkung: meist zwingend notwendig Kurzbeschreibung: Diese Datei wird verwendet, um die php-Klasse (bzw. deren Funktion) via Namespace zu deklarieren.

 path: '/Pfad/zu/[modulname]'
 defaults:
   _controller: '[namespace - definiert in php-Datei im /src-Verzeichnis]\[Klassenname]' (Optional mit Funktionsaufruf: [...]::[public Klassen-Funktion]")
   _title: [Titel]
 requirements:
   _permission: 'access content'


[modulname].links.menu.yml

Bemerkung: optional Kurzbeschreibung: Backend-Menüeinbindung im Modul

 [modulname].admin:
   title: [Titel der Settings-Seite]
   description: [Beschreibung der Settings-Seite]
   parent: system.admin_config_development
   route_name: [modulname].content
   weight: 100
  • Optional: Route definieren
   route_name: [modulname]

[modulname].libraries.yml

Bemerkung: optional Kurzbeschreibung: Einbindung von js-, css- und anderen Bibliotheken

 global-styling:
   version: 1.x
     css:
       theme:
         css/slider.css: {}
         fonts/css/font-awesome.css: {}
         ...usw...