Page 1 of 1

New Tools Module: CGSimpleSmarty

Posted: Tue Dec 11, 2007 5:03 pm
by calguy1000
The first version of the CGSimpleSmarty module has been released.

What Does This Do?

This module provides some simple smarty utilities for use in applications or for customizing the behaviour of your CMS Made Simple pages.

How Do I Use It:

When this module is installed, a new smarty object named cgsimple is automatically available to your page templates, global content blocks, and various module templates. This smarty object has numerous functions that you can call at any time.

Available Functions:

    * module_installed($modulename,[$assign])

      Test if a particular module is installed.

      Arguments:
          o $modulename - The name of the module to check
          o [$assign] - (optional) The name of a variable to assign the results to.

      Example:

      {if $cgsimple->module_installed('FrontEndUsers')}Found FEU{/if}

    * module_version($modulename,[$assign])

      Return the version number of a specific installed module

      Arguments:
          o $modulename - The name of the module to check
          o [$assign] - (optional) The name of a variable to assign the results to.

      Example:

      {$cgsimple->module_version('FrontEndUsers','feu_version')}We have Version {$feu_version} of FrontEndUsers

    * get_parent_alias([$alias],[$assign])

      Returns the alias of the specified pages parent. Returns an empty string if there is no parent.

      Arguments:
          o [$alias] - (optional) The page alias to find the parent of. If no value is specified, the current page is used.
          o [$assign] - (optional) The name of a variable to assign the results to.

      Example:

      The parent page alias is {$cgsimple->get_parent_alias()}

    * get_root_alias([$alias],[$assign])

      Returns the alias of the specified pages root parent. Returns an empty string if there is no root parent.

      Arguments:
          o [$alias] - (optional) The page alias to find the root parent of. If no value is specified, the current page is used.
          o [$assign] - (optional) The name of a variable to assign the results to.

      Example:

      The root parent page alias is {$cgsimple->get_root_alias()}

    * get_page_title([$alias],[$assign])

      Returns the title of the specified page.

      Arguments:
          o [$alias] - (optional) The page alias to find the title of. If no value is specified, the current page is used.
          o [$assign] - (optional) The name of a variable to assign the results to.

      Example:

      The title of the current page is {$cgsimple->get_page_title()}

    * has_children([$alias],[$assign])

      Test if the specified page has children.

      Arguments:
          o [$alias] - (optional) The page alias to test. If no value is specified, the current page is used.
          o [$assign] - (optional) The name of a variable to assign the results to.

      Example:

      {$cgsimple->has_children('',)}{if }The current page has children{else}The current page has no children{/if}

    * get_page_content($alias,[$block],[$assign])

      Returns the text of a specific content block of another page.

      Arguments:
          o $alias - The page alias to extract content from.
          o [$block] - (optional) The name of the content block in the specified page. if this variable is not specified, 'content_en' is assumed.
          o [$assign] - (optional) The name of a variable to assign the results to.

      Example:

      The title of the current page is {$cgsimple->get_page_title()}

Re: New Tools Module: CGSimpleSmarty

Posted: Wed Dec 12, 2007 4:15 pm
by calguy1000
anybody that has any good ideas as to what other potentially re-useable UDT's I could throw in for everybody to use.... let me know.... I'll take a look.

Re: New Tools Module: CGSimpleSmarty

Posted: Thu Dec 13, 2007 4:30 pm
by DaveW
Ok.

I am looking for a module that will read an email account and post the information to the news module.  Haven't done looking if already exists...

Subject could be encoded to include the TITLE and CATEGORY of the news and the news would be in the body of the email.  Support for HTML with embedded images would be cool.  Kind of like moblogging I guess.

What do you think?  Thanks for listening.

DW

Re: New Tools Module: CGSimpleSmarty

Posted: Thu Dec 13, 2007 4:41 pm
by nuno
very Useful good job

Re: New Tools Module: CGSimpleSmarty

Posted: Thu Dec 13, 2007 4:58 pm
by calguy1000
DaveW wrote: Ok.

I am looking for a module that will read an email account and post the information to the news module.  Haven't done looking if already exists...

Subject could be encoded to include the TITLE and CATEGORY of the news and the news would be in the body of the email.  Support for HTML with embedded images would be cool.  Kind of like moblogging I guess.

What do you think?  Thanks for listening.

DW
Nope, it doesn't already exist, and this a function for a whole new module.... not a simple UDT in CGSimpleSmarty.