You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to create slugs based on the hierachy? For example I have a hierachy that looks like this,
Clothing (entry with slug of our-clothes)
Clothing Styles (passive no slug)
a. Jeans (entry child of "Clothing" with slug of jeans, so would expect nav menu href to be "our-clothing/jeans")
b. Jumpers ("our-clothing/jumpers")
c. Hoodies ("our-clothing/hoodies")
d. T-shirts ("our-clothing/t-shirts")
My current graphql preview implmentation just returns the url/uri/slug of the entry and not it's parent or hierachy?
query Components {
navigationNodes(navHandle: "mainMenu") {
title
url
element {
slug
title
uri
}
children {
title
url
element {
title
slug
uri
}
children {
title
url
element {
title
slug
uri
}
}
}
}
}
Basically what I am wanting it a node to have a href of it's entries slug and it's parent's slug if it indeed has a parent. Is this possible?
Additional context
No response
The text was updated successfully, but these errors were encountered:
So long as I understand correctly, this isn't something that's possible or going to be incorporated. Navigation doesn't define the URL or slug of element nodes, that's defined by the element. This is so that your Navigation can define a structure that's independent of the elements you pick.
So you might have your entries in a structure with parent/child relationships (which affect the uri of the entries), but this is different to the structure in the navigation.
In your example, with jeans as the slug, if there's no parent entry relationship to our-clothes, then the uri of the entry won't reflect that, no matter how you set your hierarchy in Navigation. This is also because element nodes use the uri of the linked-to element, rather than the hierarchy. So you could need to have "Our Clothes" as a parent entry to "Jeans" to get the structure you are after.
Question
It is possible to create slugs based on the hierachy? For example I have a hierachy that looks like this,
a. Jeans (entry child of "Clothing" with slug of jeans, so would expect nav menu href to be "our-clothing/jeans")
b. Jumpers ("our-clothing/jumpers")
c. Hoodies ("our-clothing/hoodies")
d. T-shirts ("our-clothing/t-shirts")
My current graphql preview implmentation just returns the url/uri/slug of the entry and not it's parent or hierachy?
Basically what I am wanting it a node to have a href of it's entries slug and it's parent's slug if it indeed has a parent. Is this possible?
Additional context
No response
The text was updated successfully, but these errors were encountered: