tag:help-archives.hannonhill.com,2010-02-09:/discussions/xslt-formats/823-xslt-help-create-faculty-directoryCascade CMS: Discussion 2013-08-19T21:29:18Ztag:help-archives.hannonhill.com,2010-02-09:Comment/267308792013-05-08T12:24:35Z2013-05-08T12:24:35ZXSLT Help Create Faculty Directory<div><p>Hi Akbar,</p>
<p>The only thing I can think of is perhaps your faculty Pages are
not set up the same as the example, because the grouping within the
Format (ie the <code><xsl:key></code>) is expecting a field
called <strong>depts</strong>. Can you confirm you have your
Dynamic Metadata for the faculty Pages set up the same as the
example?</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/267308792013-05-08T15:33:31Z2013-05-08T15:33:31ZXSLT Help Create Faculty Directory<div><p>Hi Ryan,</p>
<p>You nailed that one in the head. I had the Dynamic field
identifier as "departments" and the format was expecting "depts". I
changed that and it resolved that issue.</p>
<p>I am also trying to pull some other information from the Faculty
profile pages to the "directory" page. Information like Office,
Phone, email and photo. I am attaching a screen shot of my data
definition for that. I am attaching my XSLT format. I added just
one line to the original XSLT to pull office:<br>
<br>
<br>
However, office is not showing up on the page.</p>
<p>What am I doing wrong?</p>
<p>Thanks,</p>
<p>Akbar</p></div>aehsantag:help-archives.hannonhill.com,2010-02-09:Comment/267308792013-05-08T18:35:59Z2013-05-08T18:35:59ZXSLT Help Create Faculty Directory<div><p>Thank you for following up, Akbar. Glad to hear that did the
trick.</p>
<p>For your latest update, it looks like the <em>office</em> field
is within a <em>Contact Information</em> Group in the Data
Definition. Because it is within a group, you will also need to
include the Group's identifier in the XPath used to output the
value.</p>
<p>For example, let's assume the identifier for the <em>Contact
Information</em> group is <code>contact-info</code> and the
<em>Office</em> field identifier is <code>office</code>. You would
use the following:</p>
<pre>
<code><xsl:value-of select="contact-info/office" /></code>
</pre>
<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/267308792013-05-08T18:56:45Z2013-05-08T18:56:45ZXSLT Help Create Faculty Directory<div><p>Hi Ryan,</p>
<p>In order for it to work, I had to add, first:<br>
To system-index-block area of the code.<br>
And then I had code office and phone in the following way to show
up:<br>
<br>
<br>
Did I need to code system-data-structure? Or am I missing something
here?</p>
<p>Also, I am trying to pull body-title that is part of the Data
Definitions that this page is built on. I am not able to do that
through XSLT.</p>
<p>Thanks,</p>
<p>Akbar</p></div>aehsantag:help-archives.hannonhill.com,2010-02-09:Comment/267308792013-05-08T20:13:50Z2013-05-08T20:13:50ZXSLT Help Create Faculty Directory<div><p>Ah, my apologies Akbar, you do need to add
<strong>system-data-structure</strong> to the front to access the
Data Definition fields, because you are within the
<strong>system-page</strong> element at that point.</p>
<blockquote>
<p>Also, I am trying to pull body-title that is part of the Data
Definitions that this page is built on. I am not able to do that
through XSLT.</p>
</blockquote>
<p>I am not sure if I understand. Is this another field within the
Data Definition? If so, you would use similar XPath to access the
field.</p>
<p>Note: when dealing with WYSIWYG content, you will want to use
the following notation:</p>
<pre>
<code><xsl:copy-of select="XPATH_TO_FIELD/node()" /></code>
</pre>
<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/267308792013-05-08T20:35:55Z2013-05-08T20:35:55ZXSLT Help Create Faculty Directory<div><p>Hi Ryan,</p>
<p>Yes, it is part of a Data Definition that is used by all other
pages including the index page of the faculty directory. See
attached screenshot. I am also including my current XSLT format
that builds the faculty index (directory) page. Also included is
the screenshot of the Faculty Directory page as it is being built.
As you can see, we are building indivudual FAculty Profile pages
from which we are pulling Name, web URL, Title, Office, Phone and
photos on to the Directory page using Index block and the XSLT
format I am attaching.</p>
<p>If you need something more, please let me know and I will
provide them to you.</p>
<p>Thanks,</p>
<p>Akbar</p></div>aehsantag:help-archives.hannonhill.com,2010-02-09:Comment/267308792013-05-08T20:47:51Z2013-05-08T20:47:51ZXSLT Help Create Faculty Directory<div><p>Thank you for the additional information. Because you are
already applying an Index Block to the region, you will need to
also enable the <strong>Append Calling Page Data</strong> option
within your <em>current folder</em> Index Block. This will allow
you to gain access to this WYSIWYG from within your Format.</p>
<p>Let's assume your <em>Body Content</em> field identifier is
<code>content</code>. Once you enabled the <em>Append Calling Page
Data</em> option, you can access this field using the
<code>calling-page/system-page</code> element. Try the following
snippet out in your Format and let me know how it works out:</p>
<pre>
<code>...
<xsl:template match="/system-index-block">
<h3>Faculty Directory</h3>
<xsl:copy-of select="calling-page/system-page/system-data-structure/content/node()" />
<xsl:for-each select="descendant::system-page[name != $indexPageName][generate-id(.) = generate-id(key('faculty-by-dept', dynamic-metadata[name = 'depts']/value))]">
<xsl:sort data-type="text" order="ascending" select="dynamic-metadata[name = 'depts']/value"/>
<strong>
<xsl:value-of select="dynamic-metadata[name='depts']/value"/>
</strong>
<p>
<xsl:apply-templates select="key('faculty-by-dept', dynamic-metadata[name='depts']/value)">
<xsl:sort data-type="text" order="ascending" select="display-name"/>
</xsl:apply-templates>
<xsl:apply-templates select="system-page"/>
</p>
</xsl:for-each>
</xsl:template>
...</code>
</pre>
<p>Note: because you are excluding Pages named <em>index</em> when
generating your <code><xsl:key></code>, this will ensure the
Calling Page, or any other index Page, is not included when
generating your list.</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/267308792013-05-09T15:31:37Z2013-05-09T15:31:37ZXSLT Help Create Faculty Directory<div><p>Hi Ryan,</p>
<p>Thanks a lot. That fixed the problem.</p>
<p>Akbar</p></div>aehsantag:help-archives.hannonhill.com,2010-02-09:Comment/267308792013-05-09T18:32:21Z2013-05-09T18:32:21ZXSLT Help Create Faculty Directory<div><p>Thank you for following up, Akbar. Glad to hear that did the
trick.</p>
<p>Have a great day!</p></div>Ryan Griffith