Skip to content
Everett Griffiths edited this page Dec 4, 2013 · 6 revisions

Elements

These are the bread and butter of MODX add-ons, and Repoman will see them if they are stored inside your package's core/components//elements directory. Use the following conventions:

Chunks

  • Directory : elements/chunks/
  • Filename : anything, e.g. x.tpl, mychunk.chunk.html, zzz.php
  • Contents : plain text, the main part of the Chunk

Example

<!--
@name MyChunk
@description This is my chunk
@static true
-->
This is my chunk...

Snippets

  • Directory : elements/snippets/
  • Filename : .php files
  • Contents : PHP code

Example

<?php
/**
 * @name MySnippet
 * @description This is my snippet
 * @static true
 */
return 'Hello world...';

Plugins

Templates

  • Directory : elements/templates/
  • Filename : anything, e.g. x.tpl, mychunk.template.html, zzz.php
  • Contents : plain text, the main part of the Template

Example

<!--
@name One-Column
@description My sample template using Bootstrap
-->
<html>
<head>
  <title>[[*pagetitle]]</title>
  ...etc...

Clone this wiki locally