tidy | compact | minify your html source code.

Posted by Damodar Bashyal on April 20, 2009

 

On next release I'll be adding html minify. This will remove unnecessary spaces and lines which are just the waste for bandwidth. The less size the file it loads faster. Also it saves bandwidth of the visitor. I have already applied to my site today. If you view the source code of this page you will understand what i am talking about.

Google's pages are compact, so probably it will like this idea and also other search engines. But of course this feature will be optional, which you can turn on/off for entire size and also set different on/off option for some controllers/pages.

More»

How to load a php block in your customised theme?

Posted by Damodar Bashyal on April 11, 2009

 

How to load a codefight cms block in certain area?

Since i started to code my cms, i have learnt new things and ideas. My latest addition is blocks. I have created blocks of different parts, or say features. This one is currently working for template view files. Because of this, its quite easy to build a new theme for codefight cms.

If you check the file tree image you will get some idea. Or, for more detail you can download the cms. This is how blocks are loaded in the area you want:

$this->blocks->load('block_name');

or, you can even load a different blocks with one call using array as:

More»

How does TAG cloud works in Codefight CMS?

Posted by Damodar Bashyal on April 06, 2009

 

How does TAG cloud works in Codefight CMS?

Admin/Modules/Pages/Controllers/Pages.php:

In admin when creating page, if tags are set split tags separated with commas. Then clean up every tag for tag-key as $tag. Then insert the tags into tag clouds table.

<?php
if(isset($pages_tags))
{
$pages_tags = split(',',$pages_tags);
if(is_array($pages_tags) && count($pages_tags) > 0)
foreach($pages_tags as $v)
{
//clean tag
$tag = $this->data_model->link_clean($v);
//add|increment tag count
$this->data_model->tag_cloud_add($tag, 'page', $v);
//insert tags to tags table
$this->db->insert('pages_tags', array('pages_id' => $page_id, 'tags' => $tag));
}
}
?>
Admin/Models/Data_model.php

More»