[solved] Randomise page alias when page first created
Posted: Sat Apr 26, 2014 1:44 am
Several clients have needed a simple way to "hide" pages on their website so they are only viewable to visitors who have been provided with the page URL. I do this by creating a special page template with a "noindex" metatag, and then advise them when creating the page to:
- uncheck "Show in menu"
- replace the default page alias with a random string of letters (so the URL is more difficult for a non-authorised visitor to guess)
BTW, I realise this doesn't provide a great deal of security - it's just for basic privacy.
This is all fine, but I thought I'd see if there is a way to automate this process. I was thinking of attaching a UDT to an appropriate event, which did something like...
if page parent = x then uncheck "Show in Menu" and replace page alias with randomised string
But I can't see an event that fires only when a page is first created. There's ContentEditPre/Post, but I don't want the alias randomised on every edit. Is there a suitable event I can attach to, or any other suggestions on achieving this?
Thanks.
- uncheck "Show in menu"
- replace the default page alias with a random string of letters (so the URL is more difficult for a non-authorised visitor to guess)
BTW, I realise this doesn't provide a great deal of security - it's just for basic privacy.
This is all fine, but I thought I'd see if there is a way to automate this process. I was thinking of attaching a UDT to an appropriate event, which did something like...
if page parent = x then uncheck "Show in Menu" and replace page alias with randomised string
But I can't see an event that fires only when a page is first created. There's ContentEditPre/Post, but I don't want the alias randomised on every edit. Is there a suitable event I can attach to, or any other suggestions on achieving this?
Thanks.