Skip to content

Allow structures to have a "homepage" #1490

Closed

Description

@leevigraham

Description

Let's say I have a section of my site called "Services" with urls that look like:

  • /services
  • /services/web-development
  • /services/web-development/craft-cms
  • /services/web-design

and I want to limit editing of these entries to a particular user / group.

There's two ways I could go about this:

Option 1. Create a new structure

I could create a new structure called "Services" with the Entry URL Format set to {slug}. A parent page would need to be created called Services with the uri: /services. This would list all the services and probably be a different entry type Services Index. Then authors could publish sub pages below 'Services' with a different entry type Service Detail.

The issue with this approach is that an author could publish an entry with any URL becuase they are not limited to just /services as defined by the 'Entry URL format' structure setting.

Option 2: Structure + Single

An alternative is to create a single for 'Services' with a locked down url and a structure for the Service details. This allows for fine grained permissions on both the index and the structure. The only downside is that the author needs to look in Singles to change the index, and 'Services' structure to change the entries. Using Expanded Singles makes this a bit easier but then there are two 'Services' links in the sidebar.

Option 3: Allow an entry to be the 'homepage' for a structure.

I'm thinking adding an option to structure entries for 'This is for the structure homepage' could work here. If the checkbox was clicked the uri for the structure would be set to / instead of the slug.

I'm already hacking something similar with a 'Site Structure' by setting the slug for one entry to __home__.

image

Activity

  1. added
    enhancementimprovements to existing features
    and removed on Mar 5, 2019
  2. locked and limited conversation to collaborators on Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementimprovements to existing features

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions