本文整理汇总了PHP中Mage_Catalog_Block_Product_Abstract::_prepareLayout方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Block_Product_Abstract::_prepareLayout方法的具体用法?PHP Mage_Catalog_Block_Product_Abstract::_prepareLayout怎么用?PHP Mage_Catalog_Block_Product_Abstract::_prepareLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Catalog_Block_Product_Abstract
的用法示例。
在下文中一共展示了Mage_Catalog_Block_Product_Abstract::_prepareLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareLayout
protected function _prepareLayout()
{
if ($breadcrumbsBlock = $this->getLayout()->getBlock('breadcrumbs')) {
$breadcrumbsBlock->addCrumb('home', array('label' => Mage::helper('catalog')->__('Home'), 'title' => Mage::helper('catalog')->__('Go to Home Page'), 'link' => Mage::getBaseUrl()));
}
parent::_prepareLayout();
}
示例2: _prepareLayout
protected function _prepareLayout()
{
$title = $this->getHeaderText();
$this->getLayout()->getBlock('head')->setTitle($title);
$this->getLayout()->getBlock('root')->setHeaderTitle($title);
return parent::_prepareLayout();
}
示例3: _prepareLayout
/**
* Preparing layout
*
* @return Mage_Catalog_Block_Product_Compare_List
*/
protected function _prepareLayout()
{
if ($headBlock = $this->getLayout()->getBlock('head')) {
$headBlock->setTitle(AO::helper('catalog')->__('Compare Products List') . ' - ' . $headBlock->getDefaultTitle());
}
return parent::_prepareLayout();
}
示例4: _prepareLayout
/**
* Add meta information from product to head block
*
* @return Mage_Catalog_Block_Product_View
*/
protected function _prepareLayout()
{
$this->getLayout()->createBlock('catalog/breadcrumbs');
$headBlock = $this->getLayout()->getBlock('head');
if ($headBlock) {
$product = $this->getProduct();
$title = $product->getMetaTitle();
if ($title) {
$headBlock->setTitle($title);
}
$keyword = $product->getMetaKeyword();
$currentCategory = Mage::registry('current_category');
if ($keyword) {
$headBlock->setKeywords($keyword);
} elseif ($currentCategory) {
$headBlock->setKeywords($product->getName());
}
$description = $product->getMetaDescription();
if ($description) {
$headBlock->setDescription($description);
} else {
$headBlock->setDescription(Mage::helper('core/string')->substr($product->getDescription(), 0, 255));
}
if ($this->helper('catalog/product')->canUseCanonicalTag()) {
$params = array('_ignore_category' => true);
$headBlock->addLinkRel('canonical', $product->getUrlModel()->getUrl($product, $params));
}
}
return parent::_prepareLayout();
}
示例5: _prepareLayout
protected function _prepareLayout()
{
parent::_prepareLayout();
$toolbar = $this->getToolbarBlock();
$collection = $this->getCollection();
if ($orders = $this->getAvailableOrders()) {
$toolbar->setAvailableOrders($orders);
}
if ($sort = $this->getSortBy()) {
$toolbar->setDefaultOrder($sort);
}
if ($dir = $this->getDefaultDirection()) {
$toolbar->setDefaultDirection($dir);
}
$toolbar->setCollection($collection);
$this->setChild('toolbar', $toolbar);
$this->getCollection()->load();
$partner = $this->getProfileDetail();
if ($partner->getShoptitle() != '') {
$this->getLayout()->getBlock('head')->setTitle($partner->getShoptitle());
} else {
$this->getLayout()->getBlock('head')->setTitle($partner->getProfileurl());
}
$this->getLayout()->getBlock('head')->setKeywords($partner->getMetaKeyword());
$this->getLayout()->getBlock('head')->setDescription($partner->getMetaDescription());
return $this;
}
示例6: _prepareLayout
/**
* Retrieve loaded category collection
*
* @return Mage_Eav_Model_Entity_Collection_Abstract
*/
public function _prepareLayout()
{
/**
* SEO Meta Keywords, title, descriptions for deal page
*/
$STORE_CONFIG_SEO_META_TITLE = Mage::getStoreConfig('superdeals/seosettings/seotitle');
/** getting seo keyword */
$STORE_CONFIG_SEO_META_KEYWORDS = Mage::getStoreConfig('superdeals/seosettings/seokeyword');
/** getting seo description */
$STORE_CONFIG_SEO_META_DESCRIPTION = Mage::getStoreConfig('superdeals/seosettings/seodescription');
/** getting head block */
if ($headBlock = $this->getLayout()->getBlock('head')) {
/** set title */
$headBlock->setTitle($STORE_CONFIG_SEO_META_TITLE);
/** set keywords */
$headBlock->setKeywords($STORE_CONFIG_SEO_META_KEYWORDS);
/** set description */
$headBlock->setDescription($STORE_CONFIG_SEO_META_DESCRIPTION);
}
/** breadcrumbs */
$breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
/** add crumbs */
$breadcrumbs->addCrumb('home', array('label' => Mage::helper('cms')->__('Home'), 'title' => Mage::helper('cms')->__('Home Page'), 'link' => Mage::getBaseUrl()));
/** addcrumbs deals */
$breadcrumbs->addCrumb('deals', array('label' => 'Deals', 'title' => 'Deals'));
return parent::_prepareLayout();
}
示例7: _prepareLayout
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->setTemplate("affiliatepluswidget/products.phtml");
$this->_prepareWidgetData();
return $this;
}
示例8: _prepareLayout
/**
* Add meta information from product to head block
*
* @return Mage_Catalog_Block_Product_View
*/
protected function _prepareLayout()
{
$this->getLayout()->createBlock('catalog/breadcrumbs');
$headBlock = $this->getLayout()->getBlock('head');
if ($headBlock) {
$product = $this->getProduct();
$title = $product->getMetaTitle();
if ($title) {
$headBlock->setTitle($title);
}
$keyword = $product->getMetaKeyword();
$currentCategory = Mage::registry('current_category');
if ($keyword) {
$headBlock->setKeywords($keyword);
} elseif ($currentCategory) {
$headBlock->setKeywords($product->getName());
}
$description = $product->getMetaDescription();
if ($description) {
$headBlock->setDescription($description);
} else {
$headBlock->setDescription(Mage::helper('core/string')->substr($product->getDescription(), 0, 255));
}
}
return Mage_Catalog_Block_Product_Abstract::_prepareLayout();
}
示例9: _prepareLayout
/**
* Add meta information from product to head block
*
* @return Mage_Catalog_Block_Product_View
*/
protected function _prepareLayout()
{
$this->getLayout()->createBlock('catalog/breadcrumbs');
$headBlock = $this->getLayout()->getBlock('head');
if ($headBlock) {
$title = $this->getProduct()->getMetaTitle();
if ($title) {
$headBlock->setTitle($title);
}
$keyword = $this->getProduct()->getMetaKeyword();
$currentCategory = Mage::registry('current_category');
if ($keyword) {
$headBlock->setKeywords($keyword);
} elseif ($currentCategory) {
$headBlock->setKeywords($this->getProduct()->getName());
}
$description = $this->getProduct()->getMetaDescription();
if ($description) {
$headBlock->setDescription($description);
} else {
$headBlock->setDescription($this->getProduct()->getDescription());
}
}
return parent::_prepareLayout();
}
示例10: _prepareLayout
protected function _prepareLayout()
{
if ($breadcrumbsBlock = $this->getLayout()->getBlock('breadcrumbs')) {
$product = $this->getProduct();
$sess = Mage::getSingleton('udropship/session');
$searchUrlKey = $sess->getData('udsell_search_type') ? 'mysellSearch' : 'sellSearch';
if ($sess->getData('udsell_search_type')) {
$breadcrumbsBlock->addCrumb('sellyours', array('label' => Mage::helper('catalog')->__('My Sell List'), 'title' => Mage::helper('catalog')->__('My Sell List'), 'link' => $this->getUrl('udsell/index/mysellSearch')));
} else {
$breadcrumbsBlock->addCrumb('sellyours', array('label' => Mage::helper('catalog')->__('Sell Yours'), 'title' => Mage::helper('catalog')->__('Sell Yours'), 'link' => $this->getUrl('udsell/index/sellSearch')));
}
if (Mage::registry('current_category')) {
$cat = Mage::registry('current_category');
$pathIds = explode(',', $cat->getPathInStore());
array_shift($pathIds);
$cats = Mage::helper('udropship/catalog')->getCategoriesCollection($pathIds);
foreach ($cats as $c) {
$breadcrumbsBlock->addCrumb('sellyours_cat' . $c->getId(), array('label' => $c->getName(), 'title' => $c->getName(), 'link' => $this->getUrl('udsell/index/' . $searchUrlKey, array('_current' => true, 'c' => $c->getId()))));
}
$breadcrumbsBlock->addCrumb('sellyours_cat' . $cat->getId(), array('label' => $cat->getName(), 'title' => $cat->getName(), 'link' => $this->getUrl('udsell/index/' . $searchUrlKey, array('_current' => true, 'c' => $cat->getId()))));
}
$breadcrumbsBlock->addCrumb('sellyours_query', array('label' => htmlspecialchars($product->getName()), 'title' => htmlspecialchars($product->getName()), 'link' => $this->getUrl('*/*/*', array('_current' => true))));
}
return Mage_Catalog_Block_Product_Abstract::_prepareLayout();
}
示例11: _prepareLayout
/**
* Placeholder function to add js/css to the top of the page.
* Only works if it's an instance widget or inserted into the layout the normal way.
* If it's a widget, you add {{widget type="dhcarousel/carousel"}} to a CMS page.
*/
protected function _prepareLayout()
{
//Place your own stuffz.
/*if ($head = $this->getLayout()->getBlock('head')) {
$head->addCss('myfile.css');
$head->addItem('skin_js','jquery/testjs.js');
}*/
return parent::_prepareLayout();
}
示例12: _prepareLayout
public function _prepareLayout()
{
parent::_prepareLayout();
$pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
$pager->setAvailableLimit($this->getPagingValues());
$pager->setCollection(Mage::helper('dailydeal')->getTodayDeals());
$this->setChild('pager', $pager);
return $this;
}
示例13: _prepareLayout
public function _prepareLayout()
{
if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) {
$breadcrumbs->addCrumb('home', array('label' => Mage::helper('edge_showcase')->__('Home'), 'title' => Mage::helper('edge_showcase')->__('Go to Home Page'), 'link' => Mage::getBaseUrl()));
$breadcrumbs->addCrumb('showcase', array('label' => Mage::helper('edge_showcase')->__('Showcase'), 'title' => Mage::helper('edge_showcase')->__('View All Articles'), 'link' => '/showcase'));
$breadcrumbs->addCrumb('date', array('label' => Mage::helper('edge_showcase')->__(date('F Y', strtotime($this->article->getDate()))), 'title' => Mage::helper('edge_showcase')->__(date('F Y', strtotime($this->article->getDate()))), 'link' => '/showcase/' . strtolower(date('Y/F', strtotime($this->article->getDate())))));
$breadcrumbs->addCrumb('article', array('label' => Mage::helper('edge_showcase')->__($this->article->getTitle()), 'title' => Mage::helper('edge_showcase')->__($this->article->getTitle())));
}
return parent::_prepareLayout();
}
示例14: _prepareLayout
protected function _prepareLayout()
{
if ($this->_show) {
$headBlock = $this->getLayout()->getBlock('head');
if ($this->getConfig('animation') == 'vrtaccordion' || $this->getConfig('animation') == 'hrzaccordion') {
$headBlock->addCss('joomlart/jmslideshow/css/jquery-ui/jquery-ui.css');
if ($this->getConfig('animation') == 'hrzaccordion') {
$headBlock->addCss('joomlart/jmslideshow/css/jquery-ui/jquery.hrzAccordion.defaults.css');
}
}
}
return parent::_prepareLayout();
}
示例15: _prepareLayout
protected function _prepareLayout()
{
parent::_prepareLayout();
$AvailableLimit = array();
$exp = explode(',', str_replace(', ', ',', (string) @$this->configP['availablelimit']));
foreach ($exp as $item) {
$AvailableLimit[$item] = $item;
}
$pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
$pager->setAvailableLimit($AvailableLimit);
$pager->setCollection($this->getCollection());
$this->setChild('pager', $pager);
$this->getCollection()->load();
return $this;
}