Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
Dynamically generate breadcrumb link base on current hashed URL

I used to have my URL look like this

http://localhost:8080/url-groups/edit/14

Now they look like this

http://localhost:8080/#/url-groups/edit/14

This fn used to slice it up nicely

links: function () {
    return [
        { text: 'Home', disabled: false, href: '/' },
        // { text: this.title, disabled: true, href: 'breadcrumbs_link_2' },
        ...new URL(window.location.href).pathname
            .split('/')
            .slice(1)
            .map((seg) => ({ text: seg, disabled: false, href: seg }))
    ]
}

To Home > URL Group > Edit > 14

How can I modify above fn() to work with my new URL format ?

Fiddle https://jsfiddle.net/bheng/grh1n6mt/

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Split the pathname by / replace '' by Home then join them using > :

links: function () {
    return new URL(window.location.href).pathname.split('/')
                                                 .map(token=>token?token:'Home')
                                                 .join(' > ')
    
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!