Add "Breadcrumbs" to Your Custom Views in SuiteCommerce

in , August 19th, 2024

This article describes the process of adding “breadcrumbs” to your views for easier navigation on a website.

What are Breadcrumbs?

Breadcrumbs are URLs that can help track navigation through a website. For example:

Breadcrumbs will only show up if the current view has a correctly formatted “getBreadcrumbPages” function. In the example above, this function returns an array of three breadcrumbs. This is because there are three separate breadcrumbs after “My Account.”

Adding Breadcrumbs: Sample Code

The “getBreadcrumbPages” function is very easy to use. See this example:

getBreadcrumbPages: function getBreadcrumbPages() {
      return [
        {
          text: 'My Subscriptions',
          href: '/subscriptions-list'
        },
        {
          text: this.subscriptionName,
          href: '/pendingsubscriptions/' + this.subscriptionId
        },
        {
          text: this.item.name,
          href: '/pendingsubscriptionitems/' + this.subscriptionId + '-' + this.itemId
        }
      ];
    },

The function simply returns an array of objects that must have a text string and href defined.

  • The test string can be whatever you want.
  • The href should point to the URL endpoint.

Put this function anywhere in your view, and you should be good to go.

Author: Sam Gagliardi

Get stuck in a step during this article?

We like to update our blogs and articles to make sure they help resolve any troubleshooting difficulties you are having. Sometimes, there is a related feature to enable or a field to fill out that we miss during the instructions. If this article didn't help you, please use the chat and let us know so we can update it!


Oracle NetSuite Alliance Partner & Commerce Partner

If you have general questions about SuiteCommerce or more specific questions about how our team can support your business as you implement NetSuite or SuiteCommerce, feel free to contact us anytime. Anchor Group is a certified Oracle NetSuite Alliance Partner and Commerce Partner equipped to handle all kinds of NetSuite and SuiteCommerce projects, large or small!

We are a premium SuiteCommerce agency that creates powerful customer portals. Unlike our competitors, we have already solved your problems.


FREE SuiteCommerce Book for Continued Learning!

Want a free paperback copy of this NetSuite e-commerce book? We even pay for shipping... Order the free SuiteCommerce book today!

 
 

Want to keep learning?

Our team of NetSuite professionals has written articles on a wide variety of NetSuite topics, from SuiteCommerce tips, to recommended NetSuite solutions, to available support services, and more! 

Your cart