craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.22k stars 627 forks source link

Structures: add option to include singles #899

Closed angrybrad closed 6 years ago

angrybrad commented 7 years ago

Created by: Timothy Kelty (timkelty@gmail.com) on 2015/04/02 12:33:05 +0000 Votes at time of UserVoice import: 14


I want to use singles, but inevitably, I just end up with a "Home" and a "404" template.

This is because I end up with a "Pages" structure. Entry types are great for this, except when something is truly a single and not a "type", it feels clumsy to have that listed in the entry types dropdown.

Singles don't work for me because I want to see the entries in the Structure tree, and also be able to include them with the output of nav tags.

My proposal is to add an option when creating a new Section to "Includes singles" where you could select singles to include when listing this structure. They would show in the CP Entries tab, and also output with nav tags. You would probably also want an indicator in the entries listing that the entry was actually a single.

Thoughts, ideas, comments?

angrybrad commented 7 years ago

Posted by Stuart McCoy (stuart@meltingcrayons.com) on 2015/03/11 01:51:01 +0000

Perhaps you could use A&M Nav or CraftPlus Nav to manage your "structure" and use singles, structures, and channels as designed?

angrybrad commented 7 years ago

Posted by shrpne (corsar89@ya.ru) on 2015/10/09 09:30:40 +0000

Also here is similar feature request: #1032

angrybrad commented 7 years ago

Posted by shrpne (corsar89@ya.ru) on 2015/10/09 09:30:40 +0000

I think here is easer way. Just create one global structure and add option to all sections (single, channel, structure) to be a part of this global structure.

angrybrad commented 7 years ago

Posted by David Ritter (david.ritter@spinthis.com) on 2015/05/18 19:35:25 +0000

I agree with this. The reason you use a Single is to introduce a separate set of fields to your content. On a bigger site, if you want to keep everything in a structure, you start to abuse Entry Types. I love entry types but they end up not being useful on one-off pages, like the About and Contact Pages that singles are supposed to solve. You still want to keep those in a structure, usually.

angrybrad commented 7 years ago

Posted by Brendan Underwood (bunderwood@brandagency.com.au) on 2015/09/11 08:36:47 +0000

This has been something that I've maybe misunderstood for some time. The #eecms addon Structure made sense for both my clients and myself. They understood that a page called News with the ability to Add/Edit News entries with links next to it made sense. Not sure why some of those features weren't carried over to Craft Structures.

angrybrad commented 7 years ago

Posted by Jure Srpcic (jure@enorog.com) on 2015/05/22 14:16:49 +0000

Our clients are struggling with this as well. It helps if I use a translation file that changes "Singles" to "Homepage" - they have to click twice, but at least it's obvious.

I usually explain that since pages are re-orderable (a structure), they need to be separate from the homepage ... but if there was a dirty way (from a dev perspective) to just attach all singles above a selected Structure (and without the reorder arrow obviously), it would solve a very typical use case. The setting would obviously have to hide "Singles" from the menu as well.

It's kind of a small thing for devs but it's the first point of contact for clients so it would help a lot.

angrybrad commented 7 years ago

Posted by Matt Wilcox (mail@matthewwilcox.com) on 2015/03/10 18:54:52 +0000

While we wait for the P&T guys to concoct a nicer solution, I've also started using the following in my _layout.html

{% if currentUser %}
    <div class="member-actions">
        <p>
            <span class="who">You're logged into the CMS as {{ currentUser }}:</span>
            {% if entry is defined and entry.isEditable() %}
                <span class="actions">
                    <a href="{{ entry.cpEditUrl }}" class="admin-edit">Edit this page</a>
                    or
                </span>
            {% endif %}
            <a href="/admin-trigger/logout">Log out</a>
        </p>
    </div>
{% endif %}

Hope that helps you out

angrybrad commented 7 years ago

Posted by Matt Wilcox (mail@matthewwilcox.com) on 2015/03/10 18:54:52 +0000

I agree exactly with your gripe - but I’m not sure adding ‘singles’ into a structure is the right answer.

The root problem is that while the sectioning elements make good sense to developers, they’re pointless for clients who just want to see a tree reflecting the front end navigation - whatever that is.

In the mean time, I too have abandoned Singles and am abusing Structure, because that makes more sense to our clients - who struggle to understand why their pages are split over three different types of grouping. They're not technical enough to grok why, they just know how to get to a page via the front end and want to follow the same logic on the backend.

brandonkelly commented 6 years ago

this will be implemented via #8427