How to add a "return" link to previous page and a label displaying its title

Highlighted
Tourist
16 0 0

Hi,

I want to add code so that when a customer navigates from one collection to another collection I can display a link on the current collection that offers the customer the option to return to the previous page. 

Ideally I want the code to pull in the previous pages title so that the link will say something along the lines of "Return to { insert previous collection name here }" and clicking it will return to the previous page.

0 Likes
Highlighted
Shopify Expert
3484 543 820

Hi @RayLyons 

Generally you can send use to back using this code:

<a href="javascript&colon; history.go(-1)">Go Back</a>

 Add this code on your page

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
Tourist
16 0 0

For improved user experience how can I pull in the previous pages title?

0 Likes
Highlighted
Shopify Expert
3484 543 820

No you can not show prev collection name if you come from other collection page.

but if you have open product page from any collection page then you can show prev collection name by following:

{% if collection %}
    <a href="{{ collection.url }}" class="btn">
      {{ collection.title }}
    </a> 
{% endif %}

Note: here product page have must collection page link like collections/collection_name/products/product_name  

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes