ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to deal with shadowboxes when no JS

December 27, 2011 8:38am

Subscribe [2]
  • #1 / Dec 27, 2011 8:38am

    Eric Snyder

    202 posts

    I have a matrix field that contains some audio/visual resources. The matrix field gives a url to the resource. The 2 resources are kept in 2 different folders to make it easier to clean out later.

    I am using shadowbox.js and it works well. It uses the url to the resource. The issue is that the customer also wants a page that is formatted in the style of their website that plays the resource. In other words, the url points to the resource itself rather than a page.

    Any ideas on how I could set things up to pass a page a url that plays the resource in context of the site design and still work as a direct resource?

  • #2 / Dec 27, 2011 8:50am

    Rob Allen

    3105 posts

    URL segments could be useful here:

    If you have your matrix page at say site.com/group/page/entry-name you could use Matrix’s row_id variable to create custom URL’s for each matrix item, eg

    {if segment_4 == ""}
    {matrix_field}
    <a href="http://site.com/group/page/entry-name/{row_id}">{matrix_field_name}</a>
    {/matrix_field}
    {if}

    That would give you Matrix generated URL’s for each of your resources, eg:
    site.com/group/page/entry-name/11
    site.com/group/page/entry-name/12
    site.com/group/page/entry-name/13

    You could then use a conditional to test for the row_id segment and output your stuff there to mimick a single page:

    {if segment_4 != ""}
    {matrix_field row_id="{segment_4}"}
    Your resource content
    {/matrix_field}
    {/if}

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases