jorenvanhee / craft-template-guard

Password protect any page or entry in Craft CMS.
Other
5 stars 0 forks source link

Access `entry` variable of requested page on login page? #16

Closed proimage closed 10 months ago

proimage commented 11 months ago

On the login page, is there a way to access what would have been the entry variable of the requested page?

I've got a couple of reasons for wanting to do so:

jorenvanhee commented 11 months ago

This is currently not possible. What you could maybe do is use the reference in the url to the original page craft.app.request.getParam('ref'), extract the slug from that somehow and fetch an entry by slug in the template.

In the future I could maybe allow you to add more params to the url (besides ref). That would allow you to pass the entry id, and then fetch it on the login page. But currently, the login page does not have any notion of the protected entry, except for the url it should try to login on.

proimage commented 10 months ago

Ok, no biggie, thanks for letting me know.