• MODX.com

    6,672 downloads

modxSmarty

modxSmarty is an extra by fi1osof, first released on 2012-12-13.

Package Description

modxSmarty allow to use template-system Smarty in MODX front-end.

Project on GitHub: https://github.com/Fi1osof/modxSmarty

Please, feel free to ask any questions on http://modxclub.ru.

Easy use via tag {$modx}. For example {$modx->resource->get('pagetitle')}

Usage/Installation 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.

Details

Developer(s)
fi1osof
Released
2012-12-28
First seen
2012-12-13
License
GPLv2
Supported databases
Minimum MODX Requirement
2.0

modxSmarty Releases

Vendor Signature Released on
MODX.com 1.0.3-beta 2012-12-28 (11 years ago)

We've also seen 1 unverified versions of modxSmarty in use, but don't list those as we've been unable of confirming they are official releases from an official source.