modxSmarty

Creator: Nikolay Lanets (fi1osof)

Need help installing this extra?

About modxSmarty

modxSmarty using MODX-Smarty class and allow to use MODX-tags in Smarty-templates

Information

Released
December 28, 2012

Supported Database
MySQL, SQL Server

License
GPLv2

Supported Versions
2.0 - Current

Downloads
6,677

Instructions

Using MODX-elements via Smarty

{$modx}

=====================

You may use {$modx} tag with full MODX API support, for example {$modx->resource->get('pagetitle')}

Snippet

=====================

{snippet name="SnippetName" params="var=value&var2=value" parse="true"}

parse - not necessary. If set 'true', output will be parsed by MODX-parser. Default - false

params - not necessary. Can use String or Array.

Example 1

PHP: $modx->smarty->assign('params', array("param1" => "value", "param2" => "value",))

Template: {snippet name="test" params=$params}

Example 2

{snippet name="test" assign=params}{snippet name="test2" params=$params nocache}

Chunk

===================

{chunk name="ChunkName" params="var=value&var2=value" noparse="true"}

noparse - not necessary. If set 'true', output will not be parsed by MODX-parser. Default - false

params - not necessary. Can use String or Array.

System variable

{config name="configName"}

Example

{config name="site_name"}

return $modx->getOption('site_name')

Placeholder

===================

{px name="configName"}

Field

{field name="modResourceFieldName"}

Link

{link id="modResourceID"}

TV

{tv name="TvName" contentid="modResourceID" parse="true"}

contentid - not necessary. If not specified, will be used current modResource.

parse - not necessary. If set 'true', output will be parsed by MODX-parser. Default - false

Parser

===================

{parser content="some content with MODX-tags"}

Processor

===================

{processor action="web/menu/getcatalogmenu" location=path ns="npghardwarestore" params="foo=foo"}

return $modx->runProcessor();

action - required.

ns (namespace) - optionaly. If set, path for namespace_core_path/processors/ will be created automaticly

location - optionaly. See MODx::runProcessor manual.

params - optionaly. $scriptPproperties.

Addition params

===================================================

You can set this params for all this tags

assign

===================

{chunk name=chunk_name assign=param}

Assign chunk result to var $param.

nocache

===================

{chunk name=chunk_name nocache}

If Smarty caching enabled, this tag will be no-cached.

New in 1.0.3-beta

modxSmarty-1.0.3-beta

=============================================================

1. Added as_tag property in {snippet}

modxSmarty-1.0.2-beta

=============================================================

1. Fixed templates order

modxSmarty-1.0.1-beta

=============================================================

1. Added less plugin

2. Minor bugfix

modxSmarty-1.0.0-beta

=============================================================

1. Added Smarty lib v3.1.20

2. Multy templates support

3. Minor bugfix

modxSmarty-0.0.10-beta

=============================================================

1.  Added $template_url in modxSmarty plugin

modxSmarty-0.0.9-beta

=============================================================

1.  Added pagination function. Thanks for Sergey Shlyahov @Husband!

2.  Added snippet smarty.

3.  Minor bugfixes.

modxSmarty-0.0.8-beta

=============================================================

1.  Add empty Smarty compiled directory on SiteRefresh event.

2.  Add full $modx support in Smarty-templates via tag {$modx}

modxSmarty-0.0.7-beta

=============================================================

1.  Remove echo $num from spell modifier

2.  Bugfix $assign notices

3.  Minor processor-plugin code refactoring

modxSmarty-0.0.6-beta

=============================================================

1.  Added Smarty-plugin lang. Return $modx->lexicon();

2.  Added Smarty-modifier spell. Example {$var|spell:"year":"years":"years"}

modxSmarty-0.0.5-beta

=============================================================

1.  Remove print_r from processor-plugin

modxSmarty-0.0.4-beta

=============================================================

1.  Field-function refactored. Now return TV-values available

2.  Added Smarty-function processor return $modx->runProcessor()

modxSmarty-0.0.3-beta

=============================================================

1.  Added Smarty-param "assign" in all functions

2.  Smarty params "scriptProperties" for tags "snippet" and "chunk"

    renamed for "params"

modxSmarty-0.0.2-beta

=============================================================

1.  Added Smarty-function field. Return modResource field value

2.  Added Smarty-function tv. Return modTemplateVar value

3.  Added Smarty-function link. Return $modx->makeUrl();

4.  Fixed setting modxSmarty.caching

modxSmarty-0.0.1-beta

=============================================================

1. Created core

2. Created plugin Smarty initialization and clearing cache

Current releases

1.0.3-beta
View | Download
December 28, 2012
2.0 - Current