Codefight CMS - version 'Lighter'

Posted by Damodar Bashyal on June 08, 2012


As title says new version of codefight cms is now released with version number with code name 'Lighter'. In this version I have organized all the libraries and models in sub-folders and wrote helper functions to load them easily when required.

Folder structure looks like this:

 |_ libraries
 |   |_coffee
 |      |_Coffee_Library.php
 |      |_Coffee_Brand_Library.php

So to load a coffee library you would do this:


//for coffee brand

Same goes for models


//for coffee brand

How about inlinks?

I have couple of domains and I keep rotating them to see what works best, so if I add static links, I have to go back and update all of them again. So, I created tag parser, which works like this.

{{parse-tag title='CMS'}}
//returns: <a href="" title="CMS">CMS</a>

{{parse-tag url='http://d.c/' title='DC' target='_blank'}}
//you can add as many params as you want
//above will return: <a href="http://d.c/" title="DC" target="_blank">DC</a>

{{parse-tag rel='external' title='Twitter' url=''}}
//this will return: <a href="" title=" Twitter" rel="external"> Twitter</a>

{{parse-tag url=''}}
//this returns:

//and finally,
{{parse-tag url='home'}}

Similarly, You can add your own parsers under parser library folder. Check app\libraries\parser\Parser_Tag_Library.php for the code.

To add your parser, crate a library file under parser folder and config like this:
file name: Parser_Yourparser_Library.php
Class: class Parser_Yourparser_Library extends MY_Library

Then you can call your parser in cms pages like this:
{{parse-yourparser key='value' or='What ever you require on your parser'}}

If you create useful parsers, please do share with us. :)

If you like us please show it by liking and sharing us on social network sites.



not published on website

QR Code: Codefight CMS - version 'Lighter'