Jump to content

Adding General Breadcrumbs to site

Recommended Posts

Site URL: https://fox-pepper-hn5f.squarespace.com/

The Question

Hello,

I am trying to add breadcrumbs to my site (not just for products but all pages). I have Developer Mode and tried to implement the solution proposed here but it did not work. I know how to create "if-else" statements using {.equals arg 1 arg2}, which will involved part of the solution - but I need to be able to store the value of the page visited before somewhere. This variable will need to be global and static - something at the session level. This kind of scope means the variable will have to be made outside of breadcrumbs.block (JSON-T I don't think has this capacity) so I was thinking maybe I could write a js script but I don't know how to how to manipulate the breadcrumbs.block from js or how to get the value of a variable in js from the breadcrumbs.block (probably not possible).

If someone has a solution for breadcrumbs or can help me figure out how to get javascript and JSON-t file to talk to each other, that would be great!

Pseudo Code Solution:

variable last=""

variable second-to-last=""

//above stored somewhere else

If we are at Home{
        second-to-last = ""
        last = ""
        print nothing
}

Else If we are at top level navigation (navtitles like Custom Programs, About, Classes, Events)
         last = navtitle
          second-to-last = ""  
          print last   
}

Else If we are at second level navigation (Newbie Class, Open Enrollment class, etc){
       if second-to-last is empty{
              second-to-last = last
       } 
        last = navtitle
        print second-to-last / last
}

Else if we are at third level navigation (healing rhthyms, or a form){
        print second-to-last/last/navtitle
}

 


Melanie ~

Link to comment
  • Replies 0
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.