Search This Blog

Mind freaker Stuff

Please Visit my new blog http://www.mindfreakerstuff.com for new articles related to web and mobile designing.
Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Monday, October 3, 2011

Show Block on Home Page only :Mageto (Phtml File changes)

 <?php if( Mage::getSingleton('cms/page')->getIdentifier() == 'home'  && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')
                            {?>  
                         <div class="static_blocks">
                                <!--Your Content Here-->
                         </div>
<?php }?>

Friday, April 29, 2011

Simple Word triming In PHP

      <?php $Title = "This is sample text for Trimming";
                $Title = trim($Title);
                  $limit = 20; /* Trimming Value limit */
                  if (strlen($Title) > $limit) {
                        $Title = substr($Title, 0, strrpos(substr($Title, 0, $limit), ' ')).' ...';
                   }
?>