Views: Link Back To List From Detail

By: Michael Clark | Asked: 05/17/2024
ForumsCategory: General questionsViews: Link Back To List From Detail
Michael ClarkMichael Clark asked 4 weeks ago

Anyway besides javascript:history.back() to link back to the list in a View with Listing and Detail?

  • Setup: A single View with list and detail
  • Same View; not linking to a separate View
  • Use the [detaillink]on a list line item to link to detail
  • Want: Non-js-history method to link back to list view from detail

Seems like a simple thing, and yet no readily available info in the documentation.

2 Answers
Rob LeVineRob LeVine answered 4 weeks ago
If the list view is on a page, e.g., "", why can't you add an HTML link to that page? I must be missing something.
Michael ClarkMichael Clark replied 4 weeks ago

Thanks, @Rob LeVine. The View is on a page, and while page names shouldn't change, sometimes, they do. When the View (list and detail) are published with the View shortcode, the [detaillink] is relative to the page. So when it's clicked, you get the /whatever-the-page-is/... Just looking for a away. As usual, overthinking it. javascript:history.back() is completely sufficient.

Rob LeVineRob LeVine replied 4 weeks ago

I'm not a big fan of history.back() as I've had mixed results with it. I prefer some js to set up the href of the link so that clicking it goes exactly where you want it. I don't want to make it harder for you though.

Bobby Clapp answered 4 weeks ago

A possible option here ->

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community