An Easy Way to get the URL of a Object Representation

Greetings,

I'm looking for an easy way to generate the URL only of a specific media representation.

I've been trying this:

{{{<unit relativeTo="ca_objects_x_object_representations" delimiter=" ">

<unit relativeTo="ca_object_representations">

<li><a href="<?php print strip_tags("^ca_object_representations.media.large"); ?>" >^ca_object_representations.media.widethumbnail </a></li>

</unit>

</unit>}}}

Alas, it's not working out exactly the way I want it to and I suspect it's because the variable replacement is rendered after the PHP call but I don't know enough about the underlying code to be sure.

For context: I have a gallery jscript I'd really like to use for the object detail page but the code requires an Href with the "big version" of the image rather than an image tag like the ^ca_object_representations.media.size generates.

Any thoughts?

Comments

  • TSomething like this:

    {{{<unit relativeTo="ca_object_representations"><img src="^ca_object_representations.media.original.url"/></unit>}}}

    Where the <img> tag is just an example - you should use whatever tag you need for embedding. The general syntax is ^ca_object_representations.media.<version>.url where version is any valid media version in your configuration. You can also get the absolute path to the media by using "path" instead of "url" in the above.

  • Superb! That worked great.

    Is there, by any chance, a way to get the height and width using a similar mechanism?

  • Try ^ca_object_representations.media.original.width and ^ca_object_representations.media.original.height to get the values

    where "original" is replaced with the version name you're using

  • Alas, that returned empty.

  • You're running 1.7.x or 1.8.x?

  • I'm running 1.7. Would 1.8 provide that data?

Sign In or Register to comment.