Hi @ben
when I preview the URL /post/ directly in the microblog, I get the first post alphabetically. However, when I view it on my web server, I get the message “No item found”.
This is confusing and should behave the same way.
Thanks in advance.
Hi @ben
when I preview the URL /post/ directly in the microblog, I get the first post alphabetically. However, when I view it on my web server, I get the message “No item found”.
This is confusing and should behave the same way.
Thanks in advance.
The reason we do this is that if you preview the individual post page locally, by pressing command-P while on that page in Elements, you’d otherwise get an “Item not found” message.
This approach ensures you can always preview an individual post page locally without running into that issue.
Hope that makes sense ![]()
This has sparked a big discussion here:
So maybe you should change it after all? It’s not good if the preview differs from the website.
I think it’s worse if you preview an individual post page locally and always see an error.
I think it’s the other way around. Using the first one alphabetically as the default would be very clever, then it could be customized accordingly. This should also be the case on the website.
Or could a default be defined?
So if I have an individual post page on my website that’s meant to display a single blog post, you’re suggesting it should automatically fall back to showing the first post if the requested one can’t be found? Just making sure I’m understanding your proposal correctly ![]()
Here’s the reasoning behind the current behaviour: a single post page at /post is designed to show one item from a collection, identified by the ?item=slug query parameter.
When previewing /post locally in Elements, the CMS loads the first item in the collection automatically — this ensures you can preview and design the post layout without there needing to be a specific item defined. It’s especially useful when pressing Command-P to preview the page directly.
my-website.com/post?item=my-post correctly loads the my-post item.my-website.com/post?item=a-post-that-doesnt-exist shows “item not found” — because it doesn’t exist in the collection.my-website.com/post also shows “item not found”, since no item parameter is provided.I don’t believe any of these scenarios justify automatically displaying a default post.
If you feel strongly that this behaviour should be different, I’d love to hear more about why and exactly how you think it should work instead ![]()
For pages that don’t exist, the HTML error 404 page not found is usually returned. This gives me the option to create a custom error page.
If the wrong post, or no post at all, is accessed, I only get the page with the text No item found (It could be that I saved a link to an article that no longer exists…) This isn’t ideal for the visitor.
It would be better if I were then taken to a page that helps me.
How could this be implemented in Elements?
If no matching or correct article is found, the first article is displayed. This could include information on what I, as the user, can do…
Better: I have the option to define an error page. (This could then also be a ‘standard’ post.)
Currently, I solve this using a rule in the .htaccess or web.config file. This isn’t a problem for me as a technical expert, but it might be for other website developers?
The behavior in the preview is fine as it is and doesn’t need to be changed.
Please don’t misunderstand, this isn’t a big issue, but it did cause some confusion, and it took me also a while to understand the error message from Pegasus.
Thanks for taking the time to think about it.