Giter Site home page Giter Site logo

fem's Introduction

FEM - File Elements Mirroring plugin for MODx

Warning : File Elements Mirroring (FEM) is not supported anymore. The good news is that we have a new, better piece of code for that, for Revo 2.2.

Please check mirror : https://github.com/digitalbutter/MODX-Mirror

Introduction

If you create your templates and chunks in files and use include snippets to link them in the MODx manager, this plugin will save you the trouble of having to create the elements entirely.

Based on some simple folder, file and tv/chunks naming conventions, the plugin will create these elements for you in the MODx manager:

  • Templates
  • Chunks
  • TVs
  • Context settings

Installation

  1. Download the latest transport package under the packages directory.
  2. Copy to your core/packages/ directory.
  3. Install in package manager.

Folder Structure

FEM will recursively parse all contents under web_assets (in your modx root) and create the respective elements (chunks/templates/snippets). The folder names for chunks/templates/snippets can be defined in the plugin's properties.

  • web_assets/
    • chunks/
      • category/ (optional)
      • subcat/
        • chunk_name.html
    • templates/
      • template_name.html
    • snippets/
      • snippet_name.php

With the setup above, the chunk in file chunk_name.html will be created with the name fem.category.subcat.chunk_name. You can use this in your template or other chunks now with the usual MODx tag syntax:

[[$fem.category.subcat.chunk_name]]

Note that all elements (templates/chunks/snippets/tvs/settings) will have a prefix (fem.) in their names. This prefix can be changed in the plugin's properties.

TVs

To have FEM automagically create a TV and assign it to your template you used it in, use the following naming convention:

[[*prefix.optional-category.type_name]]

So for example:

[[*fem.common.image_banner]]

Will create a IMAGE TV named fem.common.image_banner, captioned as 'banner' in the category 'common'. The type must be exactly named as one of the available types in your MODx installation (text, date, image, etc). This TV will now be accessible in the templates you used it in.

Settings

Follow the same naming convention when naming your settings will have them automatically created in your 'web' context settings.

fem's People

Contributors

eprochasson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fem's Issues

Feature request - Creating assets from DB

That would be awesome to provide a way to grab elements from the DB and create the appropriates files in the file system.
The main purpose would be to install FEM on an existing MODX website and then be able to work only with file based elements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.