Search code examples
cmsmadesimple

cms made simple - Discovering the location of methods and properties for UDT's


While exploring the administration side of CMSMadeSimple 1.11.x, if you go to Extensions, then User Defined Tags, you have the ability to write custom php code by clicking on the "Add User Defined Tag" link. Once inside the panel, I am curious to know if there are any help guides to help layout a foundational code practice within this area. From where I see, I cannot find any training or template source links to actually reference data in this control panel. But if I open an existing UDT that comes with the template system (i.e. custom_copywrite), I see code like this..

//set start to date your site was published
$startCopyRight='2004';

// check if start year is this year
if(date('Y') == $startCopyRight){
// it was, just print this year
    echo $startCopyRight;
}else{
// it wasnt, print startyear and this year delimited with a dash
    echo $startCopyRight.'-'. date('Y');
}

What does that mean?

also what where do we find more properties and methods to apply or expand in this example or a blank UDT if we want to manipulate any data for the news module?


Solution

  • Would definitely recommend the CMS Made Simple Development Cookbook ... https://www.packtpub.com/web-development/cms-made-simple-development-cookbook, has some great worked examples and explains everything in detail. Some of the API has changed a little and some more changes coming up in CMSMS 2.0 but usually easy to find your way around by checking out the API as you are already doing.

    Would also suggest checking out http://www.i-do-this.com/, www.rolftjassens.com.

    Would also recommend checking out the code in the plugins directory. I've discovered a few quick solutions that way.

    As always search and post on the CMSMS forum, usually someone else has solved the same problem or will suggest a solution within a day or so.

    Chris