Don't require title in the blueprint

Now I’m forced to set the title in the blueprint. I don’t think it should be forced.

Use the slug if title is missing

If a there is no title, show the slug (folder name) wherever you need, for example in the panel SEO title, or the navigation.

The same when using

echo $page->title();

If the title is missing, show the slug (folder name) or show nothing.

That’s actually exactly how it behaves right now if the title is not set or empty (which is the same for Kirby).

Only the Panel requires the title. If you don’t need it for your templates, the Panel still needs it to display it in the sidebar etc. I think that it makes sense from the perspective of the user to have human-readable page titles everywhere in the Panel.

Yes, but when removed from the blueprint it says in the panel that the title field is required. I don’t think it should be. It always has the slug / folder when title is missing in the blueprint.

As I wrote, I think that a useful title should be mandatory to make sure there’s a user-readable title everywhere. The fallback exists and works, but I think that users shouldn’t rely on it.

What’s your use-case why you don’t want to have a title?

Also, you only have to define the title field once in every blueprint and usually it makes sense that pages do have a title if only for the reason @lukasbestle pointed out. And if you care for SEO, then it is even more important to have a proper title instead of just a one-word slug.

@texnixe @lukasbestle I usually tend to agree with you but this time I don’t.

Error message in the panel

If I don’t add title in the blueprint it says in the panel something like this…

Title is missing in blueprint, can't show your fields

Now in the panel I can’t do a thing before I add a title to my blueprint. It’s totally locked. Why not fallback to the slug in this case? Why force me to add content that I don’t use, other than beautifying the panel?

What if it was not required in the first place?

Think like this. If from the start the blueprint “title” was not required. You are as free as a bird to use your own fields. Suddenly with Kirby 2.1 the “title” field is now required. What would you think? How would you react?

I bet you would think that it could be a good thing, but that it should be optional, not forced.

SEO aspect

I work on an SEO company. I often use fields like this…

seo_title
seo_description
page_title
excerpt_title

In my setup there are no such thing as “title”. That’s too general. I have different titles depending on if it’s an archive page or a single page. The SEO title falls back to the page_title.

Waste of space

When having a “title” in the text file it takes up space. That is bad if you never use it on the frontend. As once heard: “Bytes cost money”.

Now the “title” does not only take up space in a single page, but in all pages across the whole site.

Don’t force fields

In conclusion. Don’t force fields, make them optional. When using Kirby I feel free as a bird most of the times, but this time I feel locked in.

I see your point, @jenstornell. I usually use the title for what you call “page_title” and also use additional fields like seo_title (which falls back to the forced title if absent) and seo_description. I also sometimes have a different menu_title. That’s why it doesn’t bother me to have this field, but I guess it could be made optional, then it would also be good to be able to define a custom field in the blueprint from which the “page title” shown in the panel is taken.

3 Likes

That’s an awesome solution!

2 Likes

I also agree. That seems like a complete solid solution!

Why not naming this field title then in the first place?

Personally, I have no problem whatsoever with the title field as it currently is and we have too little feedback from the rest of the community to evaluate if the current implementation is a nuisance to a majority of people, but we can always discuss, can’t we? :grinning:

Of course, discussion is great. I am just wondering, what would be the real advantage of introducing an option to define some custom field as title field replacement over just naming that specific field title (assuming that it will fulfill quite a similar function to a title)?

I think that such a feature can be useful to make Kirby more flexible. Kirby is known to start with as few assumptions as possible. Having a pre-defined field name would be one.

But we still always need at last one title, right?
So why not simply use the required title and change its label?

fields:
  title:
    label: Page title
    type: text
  seo_title:
    label: Seo title
    type: text
  …

We create pages in the panel, so I think we can say that by default the title field is expected to be the page title.

I fully agree to:

This needs no change in the programming of the panel.
And you get nearly, what you want.

Another argument against the current solution with the required title field: at the moment I’m building a website for a client with >250 products. These products all have an UID and an additional (human readable ;)) title. The UID should also be the folder’s name, ergo it’s the (current) title – and the title is the name… at the moment it is quite confusing, especially for me as the developer – for the client it doesn’t matter, there I can just handle everything with labels. But it would be great if I could just add a field uid to the panel with the option title: true (or something similar), so that my life is a little bit easier in such projects :slight_smile:

And if no field has title: true, it searches for the title-field and uses that as title…

Possible solution

title: My page
pages: true
files: true
panel_title: page_title
fields:
  seo_title:
    label: SEO title
    type: text
  seo_description:
    label: SEO description
    type: textarea
  page_title:
    label: Page title
    type: text
  excerpt_title:
    label: Excerpt title
    type: text
  sidebar_title
    label: Sidebar title
    type: text
  1. page_title is used as title in the panel, because it’s set in the panel_title.
  2. If panel_title is missing it will fallback to title.
  3. If title is missing it will fallback to slug.

Advantages of the solution above

  • No error messages when not setting a title in the blueprint
  • No extra bloat in the text files when not needed in the template files
  • It let the users deside their own field names and what they are used for
  • Starts with no assumptions and build from there, Kirby style
  • It will fallback to how it works now
  • I think it will not be too much work to code (correct me if I’m wrong)

Disadvantages of the solution above

  • Some users don’t need a change because they adapted the current workflow
  • It requires some coding from a developer like @bastianallgeier

I posted few months ago my idea for this because for one project (after this problem i writed directly a sqlite application) not need the title… where? Example in the clients data, i have example:

  • Name
  • Surname
  • Address

So now what the page title?

My idea: add the possible (I see into another cms) the possible to define from where fields get the page title, so the blueprint is this:

fields:
    page_title:
        type: title
        use:
            - name
            - surname
    name:
        label: Name
        type: text
    surname:
        label: Surname
        type: text

In this case into the panel you have the “{name} {surname}” and the filename is “{name}-{surname}”.

2 Likes

Also a great idea. +1!