Helpcenter +918010117117 https://help.storehippo.com/s/573db3149f0d58741f0cc63b/ms.settings/5256837ccc4abf1d39000001/57614ef64256dc6851749879-480x480.png" [email protected] https://www.facebook.com/StoreHippohttps://twitter.com/StoreHippohttps://www.linkedin.com/company/hippoinnovations/https://plus.google.com/+Storehippo/posts
B4,309-10 Spaze iTech Park, Sector 49, Sohna Road, 122001 Gurgaon India

ms.categories

This widget returns the list of categories in the hierarchical format.


Variables

categories
Returns array of categories in hierarchical format. Each category has various detail about itself such as name, alias, image and etc.
nameReturns the name of the category.
aliasReturns the alias of the corresponding category.
imageReturns the url of the image if the image is available within the category.
childrenReturn a children object which is itself a category with same variables

Examples

Display all categories (vuejs themes)

<ms-categories>
    <div v-if="categories && categories.length">
        <h3 v-for="category in categories">
            <a :href="'/browse/'+ category.alias" title="{{category.name}}">
                {{category.name}}
            </a>
        </h3>
    </div>
    <div v-if="!categories.length">
        {{ms.filters.translate('No category found')}}
    </div>
</ms-categories> 

Display all categories

<div ms-widget="ms.categories">
    <div ng-if="categories.length">
        <h3 ng-repeat="category in categories">
            <a ng-href="/browse/{{category.alias}}" title="{{category.name}}">
                {{category.name}}
            </a>
        </h3>
    </div>
    <div ng-if="!categories.length">
        <p>No category exist!</p>
    </div>
</div>