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}
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.

| improve this answer | |
  • 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? – Third_Hyperion Jan 22 '15 at 15:26
  • You should probably ask Matrix' devs to add support for no_results in LV. – Low Jan 22 '15 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}
| improve this answer | |

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.