Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

trying to display static block for category—will only display category view
 
fidlet
Jr. Member
 
Total Posts:  5
Joined:  2013-12-31
 

I’m trying to set up a static block for my categories. I created a phtml file, then linked this file to the static block I created:

{{block type="catalog/navigation" template="catalog/navigation/sub_navigation.phtml"}}

Then I went the Cataglog->Manage Categories and selected"Static Block Only” under Display Setting->Display mode. I selected the static block I just created.

However, when I navigate to that category on my site, it just displays the regular category view (the layout I created under template->category->view.phtml in my template folder).

Any idea what I’m doing wrong here? I tried re-indexing everything, to no avail.

 
Magento Community Magento Community
Magento Community
Magento Community
 
fidlet
Jr. Member
 
Total Posts:  5
Joined:  2013-12-31
 

Can some other setting within the admin dashboard be overriding the option to use the static block? I’ve looked at several online tutorials for creating a landing page (each one outlining the procedure I used), but it’s just not working. This is very frustrating.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pulkit Seth
Sr. Member
 
Avatar
Total Posts:  107
Joined:  2011-08-18
 

Dear,

I would suggest you to debug the static block and the code in static block, so first put some dummy text in static block and look is it coming in frontend on category page or not, after this at the very starting of your phtml file echo some dummy text and then look is it coming in frontend or not. Let me know the result..  smile

Best Regards
Pulkit Seth

 
Magento Community Magento Community
Magento Community
Magento Community
 
fidlet
Jr. Member
 
Total Posts:  5
Joined:  2013-12-31
 

Thanks! I actually got a solution from Magento Stack Exchange. I was missing the following code in: app/design/frontend/<base>/<default>/template/catalog/category/view.phtml:

<?php if($this->isContentMode()): ?>
    <?php 
echo $this->getCmsBlockHtml() ?>

<?php 
elseif($this->isMixedMode()): ?>
    <?php 
echo $this->getCmsBlockHtml() ?>
    <?php 
echo $this->getProductListHtml() ?>

<?php 
else: ?>
    <?php 
echo $this->getProductListHtml() ?>
<?php 
endif; ?>

Once I added that conditional it worked correctly.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top