3

I have a nested Structure with 3 layers like so:

  • Home
  • Services
    • Service A
      • Sub Service A
      • Sub Service B
    • Service B
  • About Us
  • Contact

Now I would like the nesting to be reflected in the URL like so:

http://example.com/services/service-a/sub-service-a

I used {parent.slug}/{slug} as the URL Format and this is working for two but not three layers.

How would the correct format look like?

9

Set the Nested Entries URL format to:

{parent.uri}/{slug}
  • As a side question: I lost this piece of code in the field while setting the structure to one level, then I could find it nowhere in the documentation of craft or twig. There is no ordered overview of this kind of variables? – noregt Mar 17 '15 at 11:13
  • I don't quite understand your question, could you please expand on it a bit? – Ben Croker Mar 17 '15 at 19:43
  • To put it simple: where can I find this {parent.uri} in the docs? – noregt Mar 18 '15 at 7:29
  • I don't see it in the docs, but the field itself contains instructions saying that "you can include tags that output entry properties", and parent is documented here: buildwithcraft.com/docs/templating/entrymodel#parent – Ben Croker Mar 19 '15 at 7:51
  • Thanks Ben, that's give me an idea about how the docs are setup :-) – noregt Mar 19 '15 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.