0

Is it possible to have a "main page" that pulls through a Low Variable tag pair with all the matrix rows, and then a view page to view each page with more details about that "one matrix row"?

{exp:low_variables:pair var="franchises_for_sale"}
    {field}
    <a href="/businesses/franchises-for-sale/{some_uri_tag_like_page_uri}">View this matrix row</a>
{/exp:low_variables:pair}

2 Answers 2

0

You could use row_id to get to the right row.

{exp:low_variables:pair var="franchises_for_sale"}
    {field}
    <a href="/businesses/franchises-for-sale/{row_id}">View this matrix row</a>
{/exp:low_variables:pair}

And on the businesses/franchises-for-sale page:

{exp:low_variables:pair var="franchises_for_sale" row_id="{segment_3}"}
    {field}
{/exp:low_variables:pair}

If you want something more readable, try creating a column for a url_title (which you'd have to fill out yourself) and use search:my_column="{segment_3}" instead.

2
  • Thank you low, and if the row_id does not exist in that particular variable? eg: /businesses/franchises-for-sale/23123123123 i want to redirect to a 404 page however {if no_results}{redirect="404"}{/if} Does not seem to work? Jan 22, 2015 at 15:26
  • You should probably ask Matrix' devs to add support for no_results in LV.
    – Low
    Jan 22, 2015 at 20:17
0

Low had the best answer (use row_id to get the right row), but I wanted to answer Third_Hyperion's question in the comments (I'm trying to get involved with answering more, and I'm new)

For "No Results" I would consider using an If Statement prior to the matrix, comparing the row_id being provided with the number of rows in the Low Variables matrix field.

{if {franchises_for_sale:total_rows} < {segment_3}}
  {redirect="404"}
{/if}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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