Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid empty title / ugly pagename #81

Open
qwertologe opened this issue Jun 15, 2016 · 3 comments
Open

Avoid empty title / ugly pagename #81

qwertologe opened this issue Jun 15, 2016 · 3 comments

Comments

@qwertologe
Copy link

It would be nice if blog__newentry_title gets the html attribute required="required" - maybe as an option?!

@michitux
Copy link
Member

Yes, that makes sense, though I'm wondering if then it shouldn't also be checked in the PHP code. I'm a bit reluctant to add more configuration options so I would probably make this default. I'm only wondering one thing: if people are using this to simply create pages that are just named after the current date by using the date prefix configuration option which would mean that an empty title is okay.

@qwertologe
Copy link
Author

I think it would be ok to use the html-attribute only.
An option is a must in my opinion. I recognized that if you use a namesspace e.g. ymd with a trailing ":", the page gets the name "start" automatically. I think, there may be a usage, where an empty title is ok. But if you use e.g. ymt_ as prefix, an empty title results in an ugly pagename. The template may fit with the title, too.
So i would be glad to force the user to use a title.

@bernhardbrunner
Copy link

bernhardbrunner commented Sep 4, 2016

This is a quite important change imo, because users entering an empty title will create blog/start.txt, which is not shown in the blog list. So, a possibly long text appears to be lost, when in fact it's just in the start page of the blog.

I have added required="yes" to the input file. Now, if the input field is empty, a popup will flash up.

syntax/blog.php
205 DOKU_TAB.DOKU_TAB.'<input class="edit" type="text" name="title" id="blog__n ↪ewentry_title" size="40" tabindex="1" required="yes"/>'.DOKU_LF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants