tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/19090-internal-link-to-image-assetCascade CMS: Discussion 2015-08-27T20:19:57Ztag:help-archives.hannonhill.com,2010-02-09:Comment/376949282015-08-18T23:32:26Z2015-08-19T13:08:09Zinternal link to image asset<div><p>Hi Dave,</p>
<p>Assuming that you can attach a Velocity format to a region of
your non-published page, you can use the <code>LocatorTool</code>
to find the ID string of an image. Here is an example of using a
Velocity format to create two links:<br></p>
<pre>
#set( $image = "/images/howto/2-column-config.jpg" )
#set( $site = "cascade-admin" )
#set( $file = $_.locateFile( $image, $site ) )
#set( $id = $file.identifier.id )
<ul>
<li><a href="http://yourdomain.edu:1234/entity/edit.act?id=$id&amp;type=file" target="_blank">Edit the file</a></li>
<li><a href="http://yourdomain.edu:1234/entity/publish.act?id=$id&amp;type=file" target="_blank">Publish the file</a></li>
</ul>
</pre>
There are a few things worth mentioning:
<ol>
<li>Given an ID string, you can use any valid URL inside Cascade to
open, edit, or publish an asset.<br></li>
<li>Note that the ampersand must be encoded, or else Velocity will
throw an exception.<br></li>
<li>I use target here. This will open a new tab or window. This is
to avoid embedding a window inside Cascade.<br></li>
<li>The file path can be from a data definition block, an index
block, or whatever source. You may need to process a link element
to get the site name.</li>
</ol>
<p>By clicking one of these links, I can either edit or publish the
image.</p>
<p>Wing</p></div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/376949282015-08-19T19:33:07Z2015-08-19T19:33:07Zinternal link to image asset<div><p>Thanks Wing! I wasn't using Velocity on this page, and wasn't
familiar with the available tools, so double thanks!</p></div>Davetag:help-archives.hannonhill.com,2010-02-09:Comment/376949282015-08-19T19:57:11Z2015-08-19T19:57:11Zinternal link to image asset<div><p>Surely you can do this using XSLT, provided you know how to
query the database directly with an XSLT format. I may talk about
that in the conference next year.</p>
<p>Wing</p></div>Wing Ming Chan