Skip to content

taufik-nurrohman/snippet-plugin-for-mecha-cms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

Snippet Plugin for Mecha CMS

Save and load your snippet data with this plugin.

This plugin allows you to load snippet data into the page and treat them as part of the page.

Usage

Text File

This shortcode will load lot\assets\__snippet\txt\foo.txt file into the page:

{{print:foo}}

This shortcode will load lot\assets\__snippet\txt\foo.txt file into the page then will replace %1$s with bar and %2$s with baz:

{{print path="foo" lot="bar,baz"}}
PHP File

This shortcode will load lot\assets\__snippet\php\foo.php file into the page:

{{include:foo}}

This shortcode will load lot\assets\__snippet\php\foo.php file into the page then will add a PHP variable named as $lot with a value of array('bar', 'baz') and $foo with a value of 1:

{{include path="lorem-ipsum" lot="bar,baz" foo="1"}}