tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/21-test-the-value-of-the-metadata-system-tagsCascade CMS: Discussion 2014-03-25T20:55:23Ztag:help-archives.hannonhill.com,2010-02-09:Comment/16567852010-05-11T19:45:46Z2010-05-11T19:45:46ZTest the value of the metadata system tags<div><p>Hi Alicia,</p>
<p>There is no way to insert logic in a Template which will swap
out certain metadata tags when values for a tag do not exist. You
should be able to accomplish this with one system region, however.
Try doing something like this:</p>
<ul>
<li>Create a new system region in your Template where you need to
output this data (I'm assuming in the <code><head></code>
tag). For example, your region might be named something like this:
<code><system-region name="keywords"/></code></li>
<li>Attach a 'current-page' index block to this region so that you
have access to the page's metadata. A 'current-page' index block is
just an index block that returns information for the current page
only.</li>
<li>Create an XSLT or Velocity Format to step through the index
block and output the keywords on the page.</li>
</ul>
<p>You could easily add some logic in your Format to determine
whether or not keywords exist in the XML returned by the index
block. If you have a list of keywords for your site handy, you
could even create a variable in your Format and have those inserted
as keywords should the page not have any keywords. This, of course,
would mean that the Format would need to be maintained if you plan
on changing keywords often.</p>
<p>If you don't want to go this route, you could potentially make
the <strong>Keywords</strong> field required for users. This would
force them to either enter keywords for the asset or select from
the Global Keywords defined in your Content Preferences.</p>
<p>Hope this helps!</p></div>Tim