1

I have entries in a structure section. I'd like the users to view the list of entries without the entries themselves being assigned URLs.

How can I set a URL for the top level of a Structure section without enabling "Entry URL Format"?

2

If I understand what you're asking—it sounds like you can just disable URLs for that section, and create a template that will get loaded at the URL you want.

For example, if you had a Section called “Plants,” and you wanted to list all plants at mywebsite.com/plants, you could just create craft/templates/plants.twig:

{% set plants = craft.entries({ section: 'plants', limit: null }).find %}

<ul>
  {% for plant in plants %}
    <li>{{ plant.title }}</li>
  {% endear %}
</ul>

If you need to edit anything on that page, you'll need to create another entry (probably a Single) to manage that content.

0

A section in Craft (regardless of it is a Single, Channel or Structure section) is defined by a combination of your Craft Site URL (defined under Settings->General or overwritten via https://craftcms.com/docs/config-settings#siteUrl) and that section's "Entry URL Format" under the section's settings (Settings->Sections->(your structure section)->Entry URL Format).

You can read more about them here: https://craftcms.com/docs/sections-and-entries

3
  • Thanks! I got a bit stuck poking around there. I was trying to find a way to do with without the entries getting a URL. I forgot that detail in the question. The demo site had a location Structure embedded in a Single that I was literally just now trying to emulate. – ponies Jan 13 '17 at 22:45
  • Actually, you answered the question I posed, but it wasn't the one I meant to ask. Would it be best to un-edit my question and accept your answer for posterity, then ask the question I meant to? – ponies Jan 13 '17 at 22:55
  • Probably best just to post a new question and leave this one here for posterity. – Brad Bell Jan 15 '17 at 4:31

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.