tag:help-archives.hannonhill.com,2010-02-09:/discussions/xslt-formats/5317-xslt-questionCascade CMS: Discussion 2015-09-22T21:06:11Ztag:help-archives.hannonhill.com,2010-02-09:Comment/342256202014-08-22T20:57:37Z2015-09-22T21:06:11ZXSLT question<div><p>Any pointers on this? I am a xslt newb and would appreciate if I
can get some help on this.</p>
<p>Thanks</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/342256202014-08-25T12:46:14Z2014-08-25T12:46:14ZXSLT question<div><p>Hi,</p>
<p>In order to render information about files and external links,
you will want to first ensure your Index Block is configured to
include the asset types. Next, you will need to adjust your Format
to render <code><system-file></code> and
<code><system-symlink></code> elements. Specifically, the
<code><xsl:for-each></code> and
<code><xsl:apply-templates></code> within the first template
will need to be adjusted to something like the following:</p>
<pre>
<code><xsl:for-each select="//system-page/start-date[count(. | key('groupbyyear', date-converter:convertYear(number(.)))[1]) = 1]|//system-file/start-date[count(. | key('groupbyyear', date-converter:convertYear(number(.)))[1]) = 1]|//system-symlink/start-date[count(. | key('groupbyyear', date-converter:convertYear(number(.)))[1]) = 1]">
<xsl:apply-templates select="../../system-page[date-converter:convertYear(number(start-date)) = $currentYear]|../../system-file[date-converter:convertYear(number(start-date)) = $currentYear]|../../system-symlink[date-converter:convertYear(number(start-date)) = $currentYear]"></code>
</pre>
<p>Alternatively, you may be able to use the following, which helps
remove some of the redundancy:</p>
<pre>
<code><xsl:for-each select="//node()[local-name() = 'system-page' or local-name() = 'system-file' or local-name() = 'system-symlink']/start-date[count(. | key('groupbyyear', date-converter:convertYear(number(.)))[1]) = 1]">
<xsl:apply-templates select="../../node()[(local-name() = 'system-page' or local-name() = 'system-file' or local-name() = 'system-symlink') and date-converter:convertYear(number(start-date)) = $currentYear]"></code>
</pre>
<p>Note: because you are grouping by the
<strong>start-date</strong> Metadata field, you will also need to
do the same for the files and symlinks.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/342256202014-08-25T14:22:02Z2015-09-22T21:06:11ZXSLT question<div><p>Thanks, Ryan.<br>
I adjusted above two lines in the first template.<br>
But I see something like this for pdf:<br>
academic-calendar.pdftrueName1408078800000Name/announcements/archives/<a>academic-calendar.pdfStem-rwdsite://Stem-rwd/announcements/archives...</a></p>
<p>and this for external link:<br>
testStudents1406869200000Students/announcements/archives/<a>testStem-rwdssargam1408743466189ssargam1408743466189https://stemlms...</a></p>
<p>The pages rendered just fine.</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/342256202014-08-25T14:54:54Z2014-08-25T14:54:54ZXSLT question<div><p>Thank you for following up.</p>
<p>I forgot to mention you will also need to create an additional
<code><xsl:template></code> for both
<strong>system-file</strong> and <strong>system-symlink</strong>
elements so you can output the information, very similar to what
you have for <strong>system-page</strong>. Because you do not have
a template for each, you are currently seeing the text contents of
the elements dumped on the screen.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/342256202014-08-25T16:44:51Z2015-09-22T21:06:11ZXSLT question<div><p>My bad, I didn't look at the template portion. Script is working
now. You may close this ticket.</p>
<p>Thanks, Ryan. You are the best.</p></div>ssargamtag:help-archives.hannonhill.com,2010-02-09:Comment/342256202014-08-25T18:16:29Z2014-08-25T18:16:29ZXSLT question<div><p>Not a problem at all, I am glad to hear you were able to get the
Format working.</p>
<p>I'm going to go ahead and close this discussion, please feel
free to comment or reply to re-open if you have any additional
questions.</p>
<p>Have a great day!</p></div>Ryan Griffith