modxSmarty

modxsmarty

  • By fi1osof
  • Latest release December 28, 2012 (13 years ago)

About

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

Installation & usage

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.

At a glance

MODX 3 compatibility unknown. Based on our testing and community reports where available.

  • Developer fi1osof
  • Latest release December 28, 2012 (13 years ago)
  • First seen in SiteDash December 13, 2012 (13 years ago)
  • License GPLv2
  • MODX support 2.0 – 100.0

Releases 1 indexed release

Changelog
MODX.com

1.0.3-beta

December 28, 2012

13 years ago

<p>modxSmarty-1.0.3-beta</p><p>=============================================================</p><p>1. Added as_tag property in {snippet}</p><p>modxSmarty-1.0.2-beta</p><p>=============================================================</p><p>1. Fixed templates order</p><p>modxSmarty-1.0.1-beta</p><p>=============================================================</p><p>1. Added less plugin</p><p>2. Minor bugfix</p><p>modxSmarty-1.0.0-beta</p><p>=============================================================</p><p>1. Added Smarty lib v3.1.20</p><p>2. Multy templates support</p><p>3. Minor bugfix</p><p>modxSmarty-0.0.10-beta</p><p>=============================================================</p><p>1.  Added $template_url in modxSmarty plugin</p><p>modxSmarty-0.0.9-beta</p><p>=============================================================</p><p>1.  Added pagination function. Thanks for Sergey Shlyahov @Husband!</p><p>2.  Added snippet smarty.</p><p>3.  Minor bugfixes.</p><p>modxSmarty-0.0.8-beta</p><p>=============================================================</p><p>1.  Add empty Smarty compiled directory on SiteRefresh event.</p><p>2.  Add full $modx support in Smarty-templates via tag {$modx}</p><p>modxSmarty-0.0.7-beta</p><p>=============================================================</p><p>1.  Remove echo $num from spell modifier</p><p>2.  Bugfix $assign notices</p><p>3.  Minor processor-plugin code refactoring</p><p>modxSmarty-0.0.6-beta</p><p>=============================================================</p><p>1.  Added Smarty-plugin lang. Return $modx-&gt;lexicon();</p><p>2.  Added Smarty-modifier spell. Example {$var|spell:"year":"years":"years"}</p><p>modxSmarty-0.0.5-beta</p><p>=============================================================</p><p>1.  Remove print_r from processor-plugin</p><p>modxSmarty-0.0.4-beta</p><p>=============================================================</p><p>1.  Field-function refactored. Now return TV-values available</p><p>2.  Added Smarty-function processor return $modx-&gt;runProcessor()</p><p>modxSmarty-0.0.3-beta</p><p>=============================================================</p><p>1.  Added Smarty-param "assign" in all functions</p><p>2.  Smarty params "scriptProperties" for tags "snippet" and "chunk"</p><p>    renamed for "params"</p><p>modxSmarty-0.0.2-beta</p><p>=============================================================</p><p>1.  Added Smarty-function field. Return modResource field value</p><p>2.  Added Smarty-function tv. Return modTemplateVar value</p><p>3.  Added Smarty-function link. Return $modx-&gt;makeUrl();</p><p>4.  Fixed setting modxSmarty.caching</p><p>modxSmarty-0.0.1-beta</p><p>=============================================================</p><p>1. Created core</p><p>2. Created plugin Smarty initialization and clearing cache</p>

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