1

working with the Shortlist plugin for Craft.

I'm trying to set the return URL after someone adds an item to their shortlist.

i assume thats what this parameter is for...

<a href="{{ item.addActionUrl({ 'return' : 'my-page-i-want-to-go-to' }) }}">add item</a>

however that takes the user to a 404 page with the url of

mydomain.com/index.php/actions/shortlist/item/my-page-i-want-to-go-to

any ideas?

  • How about something like <a href="{{ item.addActionUrl({ 'return' : url('my-page-i-want-to-go-to') }) }}">add item</a>? – Jalen Davenport Apr 11 '18 at 15:45
1

As mentioned in the comments on the Question, the solution here is to enclose your desired path with a url() function like so:

<a href="{{ item.addActionUrl({ 'return' : url('my-page-i-want-to-go-to') }) }}">add item</a>

The url() function will take your current SiteURL and append the provided path. You can view the offical documentation about url() here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.