We have a section where events are shown in a list. An email is sent out to users.
BUT if an event has ended the page is Un-Published. So when the user clicks on their email link it takes them to a 404 page.
Is there a way where the user could be taken to a different type of page - such as a friendly page explaining that the event has ended and not a 404 page?
This sounds like an ideal candidate for using the Skybrud Redirects package. Just before you unpublish the page you add an entry to Skybrud redirects and point it to the event ended page. You could even go further and hook into the unpublish event and write it into the Skybrud Redirects table automatically.
Thank you so much.
Is it possible to add a redirect into the redirects table via the Skybrud code? I have had a look but couldn't find anything but probably looking in the wrong place.
Create a Redirect when a page is unpublished
We have a section where events are shown in a list. An email is sent out to users.
BUT if an event has ended the page is Un-Published. So when the user clicks on their email link it takes them to a 404 page.
Is there a way where the user could be taken to a different type of page - such as a friendly page explaining that the event has ended and not a 404 page?
Hi Jon
This sounds like an ideal candidate for using the Skybrud Redirects package. Just before you unpublish the page you add an entry to Skybrud redirects and point it to the event ended page. You could even go further and hook into the unpublish event and write it into the Skybrud Redirects table automatically.
https://our.umbraco.com/packages/website-utilities/skybrud-redirects/
Kind regards
Paul
Thank you so much. Is it possible to add a redirect into the redirects table via the Skybrud code? I have had a look but couldn't find anything but probably looking in the wrong place.
Do you have any example code?
Thanks again
Hi Jon,
I did this using nPoco.
First I made a model matching all the columns in the table created by the Skybrud package.
Then in a service I made an add method:
Then call that add method (either in the service or from where you hook into the publish event.
Hope this helps you.
is working on a reply...