Dynamic Page 404 When DB is Empty

Hopefully a simple one.

I know that you’ll get a 404 error on a dynamic page if the database is empty, but I was hoping that I could still load the page and display some text instead? I have a gallery linked to the DB, but we don’t currently have any items in the DB. I’d like to hide the gallery and then display some text to feedback to the user that there are currently no items.

Any help would be greatly appreciated.

A Dynamic Page is created from and is dependent on the associated collection entry. For testing, you might consider using a Regular Page (you won’t need anything in the database). Then when you see the page is displaying the way you want, convert it to a Dynamic Page .

However, for sake of consistency and completeness, I would recommend using a Dynamic Page right from the beginning. Just add some test data to the database collection so that you’ll be able to view the page.

Good luck,

Yisrael

Thanks for the suggestion Yisrael. It’ll still be an issue with the live site (Our full list of product hasn’t yet been decided upon). I’ll simply hide the page from the menu for now and make it visible once we have products in the database.

If the collection is for user input, how can we handle it gracefully when collection is empty?
I would like to see a message saying like" currently there is no item!".
Thanks!

Check if there are results from the query. If there are none, then display a message.

Please add your own issue into a new post instead of bumping up an old post.
Also, add any code in a code block as stated in the Forum Guidelines.

This is an old post and is being closed.