Wednesday 30 April 2014

Split the row into columns in bootstrap 3

<!-- Bootstrap 3: Adaptive split row -->
<div class="row">
 <div class="col-xs-6 col-sm-4 col-md-3">
  Left Cell All Devices.
  Width on Mobile: 1/2 page
  Width on Tablet: 1/3 page
  Width on Desktop: 1/4 page
 </div>
 <div class="col-xs-6 col-sm-8 col-md-9">
  Right Cell All Devices
  Width on Mobile: 1/2 page
  Width on Tablet: 2/3 page
  Width on Desktop: 3/4 page
 </div>
</div>


also you can add col-lg-3 for the larger screens.

col-lg-3 is width on larger screen 1/4 page

Bootstrap Media Query Breakpoints versions wise

Bootstrap Media Query Breakpoints versions wise

Bootstrap 3 Media Queries

/* Small devices - Tablets (>768px) */ @media (min-width: 768px) @media screen and (min-width: 768px) @media (min-width: 768px) and (max-width: 991px) /* Medium devices - Desktops (>992px) */ @media (min-width: 992px) /* Large devices - Desktops (>1200px) */ @media (min-width: 1200px)


Bootstrap 2 media queries


/* Landscape phones and down */
@media (max-width: 480px) { ... }

/* Landscape phone to portrait tablet */
@media (max-width: 767px) { ... }

/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }

/* Large desktop */
@media (min-width: 1200px) { ... }


Foundation 5 new



/* Styles for screens that are at least 768px; */
@media only screen and (min-width: 48em) { ... }

/* Medium Displays: 768px - 1279px */
@media only screen and (min-width: 48em) { ... }

/* Large Displays: 1280px - 1440px */
@media only screen and (min-width: 80em) { ... }

/* X-Large Displays: 1400px and up */
@media only screen and (min-width: 90em) { ... }

/* Orientation: landscape */
@media screen and (orientation: landscape) { ... }

/* Orientation: portrait */
@media screen and (orientation: portrait) { ... }

/* Foundation Block Grids for above small breakpoint */
@media only screen and (min-width: 48em) { ... }

/* Top bar */
@media only screen and (min-width: 58.75em) { ... }



Foundation v4


/* Styles for screens that are at least 768px; */
@media only screen and (min-width: 48em) { ... }

/* Medium Displays: 768px - 1279px */
@media only screen and (min-width: 48em) { ... }

/* Large Displays: 1280px - 1440px */
@media only screen and (min-width: 80em) { ... }

/* X-Large Displays: 1400px and up */
@media only screen and (min-width: 90em) { ... }

/* Orientation: landscape */
@media screen and (orientation: landscape) { ... }

/* Orientation: portrait */
@media screen and (orientation: portrait) { ... }

/* Foundation Block Grids for above small breakpoint */
@media only screen and (min-width: 48em) { ... }

/* Top bar */
@media only screen and (min-width: 58.75em) { ... }



Foundation v3


/* Very large display targeting */
@media only screen and (min-width: 1441px) { ... }

/* Medium display targeting */
@media only screen and (max-width: 1279px) and (min-width: 768px) { ... }

/* Small display targeting */
@media only screen and (max-width: 767px) { ... }

/* Small display targeting */
@media only screen and (max-width: 767px) { ... }

/* Landscape orientation targeting */
@media screen and (orientation: landscape) { ... }

/* Portrait orientation targeting */
@media screen and (orientation: portrait) { ... }

/* Mobile styles */
@media only screen and (max-device-width: 1280px) { ... }
@media only screen and (max-width: 1279px) and (min-width: 768px) { ... }


Thursday 3 April 2014

How to get Production collection with category filter in magento?


Get Product collection and category filter in Magento
$productcollection = Mage::getModel(‘catalog/product’)->getCollection();
$productcollection = $productcollection->addCategoryFilter(Mage::getModel(‘catalog/category’)->load($currcategory),true);
$productcollection = $productcollection->addAttributeToFilter(‘special_price’, array(‘gt’ => 0));
echo $productcollection->getSize();

Wednesday 2 April 2014

How to set the page title, meta description and keywords from the Block / phtml template in magento?


$head = $this->getLayout()->getBlock('head');
       $head->setTitle($title);
       $head->setKeywords($keywords);
       $head->setDescription($description);

How to extend magento controller from core


 

<!-- define frontend configuration of the module  -->
    <frontend>
        <routers>
            <catalog>
                <use>standard</use>
                <args>
                    <module>Mycompany_Catalog</module>
                    <!-- This is used when "catching" the rewrite above -->
                    <frontName>catalog</frontName>
                </args>
            </catalog>
        </routers>
    </frontend>


Example sitemap controller extension


require_once 'Mage/Catalog/controllers/Seo/SitemapController.php';

class Mycompany_Catalog_Seo_SitemapController extends Mage_Catalog_Seo_SitemapController
{


   here your new actions

}