Skip to main content
Tweeted twitter.com/StackMagento/status/923572921116905472
added 13 characters in body
Source Link
getKeywords())?>getDescription())?>
<?php echo htmlspecialchars($this->getKeywords()) ?> <?php echo htmlspecialchars($this->getDescription()) ?> 

The goal is to be able to display each of the categories list of keywords and their descriptions within the same

  • and loop giving me a list like this

    Category Keywords, Keywords Description

  • < li > and loop giving me a list like this

    • Category
    • Keywords
    • Description
    getKeywords())?>getDescription())?>

    The goal is to be able to display each of the categories list of keywords and their descriptions within the same

  • and loop giving me a list like this

    Category Keywords, Keywords Description

  • <?php echo htmlspecialchars($this->getKeywords()) ?> <?php echo htmlspecialchars($this->getDescription()) ?> 

    The goal is to be able to display each of the categories list of keywords and their descriptions within the same < li > and loop giving me a list like this

    • Category
    • Keywords
    • Description
    Source Link

    Loop Through Magento Categories, Meta Keywords and Descriptions

    I have a file that is successfully looping through my categories and subcategories. I am successfully able to echo all the categories and their links onto this page

    http://firstaidmart.com/list-all-categories.html

    BUT

    I do not see why these (keywords and description) are not echoing

    getKeywords()) ?> getDescription()) ?>

    The file is located here app/design/frontend/mystoretheme/default/template/catalog/category/listofcats.phtml

    Then im placing it on a block in a cms page {{block type="catalog/navigation" name="catalog.category" template="catalog/category/listofcats.phtml"}}

    The goal is to be able to display each of the categories list of keywords and their descriptions within the same

  • and loop giving me a list like this

    Category Keywords, Keywords Description

    Here is my code. I have omitted my attempts at keyword and description since they are not working.

    <div class="block block-list block-categories"> <div id="block-categories" class="block-title active"> <strong><span>Categories </span></strong> </div> <div id="leftnav" class="block-content" style="display:block"> <?php $helper = $this->helper('catalog/category') ?> <?php $categories = $this->getStoreCategories() ?> <?php if (count($categories) > 0): ?> <ul id="leftnav-tree" class="level0"> <?php foreach($categories as $category): ?> <li class="level0<?php if ($this->isCategoryActive($category)): ?> active<?php endif; ?>"> <a href="<?php echo $helper->getCategoryUrl($category) ?>"><span><?php echo $this->escapeHtml($category->getName()) ?></span></a> <?php //if ($this->isCategoryActive($category)): ?> <?php $subcategories = $category->getChildren() ?> <?php if (count($subcategories) > 0): ?> <ul id="leftnav-tree-<?php echo $category->getId() ?>" class="level1"> <?php foreach($subcategories as $subcategory): ?> <li class="level1<?php if ($this->isCategoryActive($subcategory)): ?> active<?php endif; ?>"> <a href="<?php echo $helper->getCategoryUrl($subcategory) ?>"><?php echo $this->escapeHtml(trim($subcategory->getName(), '- ')) ?></a> <?php $secondLevelSubcategories = $subcategory->getChildren() ?> <?php if (count($secondLevelSubcategories ) > 0): ?> <ul id="leftnav-tree-<?php echo $subcategory->getId() ?>" class="level2"> <?php foreach($secondLevelSubcategories as $secondLevelSubcategory ): ?> <li class="level2<?php if ($this->isCategoryActive($secondLevelSubcategory )): ?> active<?php endif; ?>"> <a href="<?php echo $helper->getCategoryUrl($secondLevelSubcategory ) ?>"><?php echo $this->escapeHtml(trim($secondLevelSubcategory ->getName(), '- ')) ?></a> </li> <?php endforeach; ?> </ul> <script type="text/javascript">decorateList('leftnav-tree-<?php echo $category->getId() ?>', 'recursive')</script> <?php endif; ?> <?php endforeach; ?> </ul> <script type="text/javascript">decorateList('leftnav-tree-<?php echo $category->getId() ?>', 'recursive')</script> <?php endif; ?> <?php //endif; ?> </li> <?php endforeach; ?> </ul> <script type="text/javascript">decorateList('leftnav-tree', 'recursive')</script> <?php endif; ?> </div>