I am working on a theme which is customized by someone else.
So in
/websitename.com/app/design/frontend/rwd/ysv/template/page/category.phtml
is created which is called.When I click on any category or subcategory.
I want to show breadcrumbs, when user is on category/sub-category page.
echo $this->getLayout()->getBlock('breadcrumbs')->toHtml();
This will not help in my case i think.
System > Configuration > General > Web > Default Pages > Show Breadcrumbs for CMS Pages. is set to YES.
Update:
<catalog_category_default translate="label">
<label>Catalog Category (Non-Anchor)</label>
.........
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> <!-- Addedd -->
and
<catalog_category_layered translate="label">
<label>Catalog Category (Anchor)</label>
.....................
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<block type="core/text_list" name="product_list.name.after" as="name.after" />
<block type="core/text_list" name="product_list.after" as="after" />
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> <!-- Addedd -->
In page.xml
<!-- category (default) -->
<catalog_category_default>
<reference name="root">
<action method="setTemplate"><template>page/category.phtml</template></action>
</reference>
</catalog_category_default>
In category.phtml
<?php echo $this->getChildHtml('head'); ?>
<?php echo $this->getChildHtml('after_body_start'); ?>
<!-- global messages -->
<?php echo $this->getChildHtml('global_notices'); ?>
<!-- header -->
<?php echo $this->getChildHtml('header'); ?>
<!-- content -->
<?php echo $this->getChildHtml('content'); ?>
<!-- footer -->
<?php echo $this->getChildHtml('footer'); ?>
<?php echo $this->getChildHtml('before_body_end'); ?>
<?php echo $this->getAbsoluteFooter(); ?>
Can I create dynamic breadcrumbs based on current URL in a custom module or any other method? Please suggest.