tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/10837-cross-site-system-view-tag-issueCascade CMS: Discussion 2018-10-18T20:37:19Ztag:help-archives.hannonhill.com,2010-02-09:Comment/344964892014-09-09T12:58:51Z2014-09-09T12:58:51Zcross site system-view tag issue<div><p>Hi,</p>
<p>I would like to try and test this locally if possible. When you
have a moment, please provide the contents of the Format as well as
a sample XML from a page that is within the same Site and a page
that is in another Site. You can obtain the sample XML by editing
the Format and using the <em>Preview Options</em>, and selecting
the appropriate context Block and Page.</p>
<p>Also, what version of Cascade Server are you currently
running?</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/344964892014-09-09T13:41:06Z2014-09-09T13:41:06Zcross site system-view tag issue<div><p>Hi Ryan,</p>
<p>I’m using a data definition block which is included in a
region on both a local site and another site. Same data definition
block and same velocity script on both. I don’t get the
[system-view:internal] on the site that contains the data
definition block and velocity script. The data definition block and
script is in the default region on the local site and in an
additional region(not default) on the other site.</p>
<p>Upon investigating more, I suspect the issue is in the other
site template, where I would only like to have a region viewable
internally. I would like to use the same velocity script and data
definition block for both the include and the internal view for
Cascade. Is there another way to do this? It mostly works with the
exception of the other site printing the [system-view:internal].
Are these pseudo tags handled like they are “nested"? I can
have separate velocity scripts without pseudo tags(which I believe
would work) but it would be nice to have them combined into
one.</p>
<p>Thanks for your help,<br>
Jason</p>
<p>Include site template<br></p>
<pre>
<code><system-region name=“DEFAULT”/></code>
</pre>
<p>Other site template<br></p>
<pre>
<code>[system-view:internal]
<system-region name="INCLUDE-HEADER"/>
[/system-view:internal]
[system-view:external]
<!--#include virtual="[system-asset:id=462691d28185062c40287b90868b8545]site://Resources/includes/header[/system-asset]" -->
[/system-view:external]</code>
</pre>
<p>Data definition block<br></p>
<pre>
<code><system-data-structure>
<logo type="file">
<content/>
<path>/images/logo.gif</path>
<link>site://Resources/images/logo.gif</link>
<site>Resources</site>
<name>logo.gif</name>
</logo>
<tools type="block">
<content>
<system-data-structure>
<menu-item>
<item-text>Portfolio</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>https://webapps.wesleyan.edu/portal</external-link>
</menu-item>
<menu-item>
<item-text>Directory</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>#</external-link>
</menu-item>
<menu-item>
<item-text>Library</item-text>
<internal-link type="page">
<content/>
<path>/index</path>
<dynamic-metadata>
<name>hidefrommenu</name>
<value>No</value>
</dynamic-metadata>
<link>site://Library/index</link>
<site>Library</site>
<name>index</name>
<display-name>Library Home</display-name>
<title>Library</title>
</internal-link>
<external-link/>
</menu-item>
<menu-item>
<item-text>OneStop</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>#</external-link>
</menu-item>
<menu-item>
<item-text>WesConnect</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>#</external-link>
</menu-item>
<menu-item>
<item-text>Calendar</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>#</external-link>
</menu-item>
<menu-item>
<item-text>WesMaps</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>#</external-link>
</menu-item>
<menu-item>
<item-text>WFS</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>#</external-link>
</menu-item>
<menu-item>
<item-text>Moodle</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>#</external-link>
</menu-item>
<menu-item>
<item-text>EMS</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>#</external-link>
</menu-item>
<menu-item>
<item-text>GApps</item-text>
<internal-link>
<path>/</path>
</internal-link>
<external-link>#</external-link>
</menu-item>
</system-data-structure>
</content>
<path>/includes/menus/tools</path>
<site>Resources</site>
<name>tools</name>
</tools>
</system-data-structure></code>
</pre>
<p>The velocity script</p>
<pre>
<code>#import('/_internal/formats/menus/list-menu-macro')
#set ($tools = $_XPathTool.selectNodes($contentRoot, "//system-data-structure/tools/content/system-data-structure/menu-item"))
#set ($logoname = $_XPathTool.selectSingleNode($contentRoot, "//system-data-structure/logo/name").value)
#set ($logopath = $_XPathTool.selectSingleNode($contentRoot, "//system-data-structure/logo/link").value)
## Black bar for medium screens and up
<section class="navigation-section show-for-medium-up">
<header class="blackbar">
<div class="row">
<div class="large-8 medium-7 columns logo">
[system-view:external]<img alt="Logo: Wesleyan University" src="/resources/images/${logoname}"/>[/system-view:external]
[system-view:internal]<img alt="Logo: Wesleyan University" src="${logopath}"/>[/system-view:internal]
</div>
<div class="large-1 medium-2 columns"><a class="small button dropdown tools" data-dropdown="dropTools" href="#">Tools</a><br/>
<ul class="f-dropdown" data-dropdown-content="" id="dropTools">
#foreach($tool in $tools)
<li>#printMenuItem($tool)</li>
#end
</ul>
</div>
<div class="large-3 medium-3 columns">
<form action="http://www.wesleyan.edu/search/search-results.html" id="cse-search-box">
<div class="row">
<div class="large-12 columns">
<div class="row collapse">
<div class="medium-8 columns"><input name="cx" type="hidden" value="001254463385620737445:nbar83le1bc"/> <input name="cof" type="hidden" value="FORID:11"/> <input name="ie" type="hidden" value="UTF-8"/> <input class="tiny" name="q" size="15" type="text"/></div>
<div class="medium-4 columns"><button class="button postfix search radius">Search</button></div>
</div>
</div>
</div>
</form>
</div>
</div>
</header>
</section>
## Black bar for medium screens and up</code>
</pre>
<p>With macro</p>
<pre>
<code>#macro(printMenuItem $element)
#set($text = $element.getChild('item-text').value)
#set($internalLink = $element.getChild('internal-link').getChild('link').text)
#set($internalPath = $element.getChild('internal-link').getChild('path').text)
#set($externalLink = $element.getChild('external-link').text)
#set($path = "")
## If there is no internal page selected, set path to external link
#if($internalPath == '/')
#set($path = $externalLink)
#else
#set($path = $internalLink)
#end
<a href="$path">${_EscapeTool.html($text)}</a>
#end</code>
</pre></div>jvienneautag:help-archives.hannonhill.com,2010-02-09:Comment/344964892014-09-09T13:45:12Z2014-09-09T13:45:12Zcross site system-view tag issue<div><p>I'm running version 7.10.2.</p></div>jvienneautag:help-archives.hannonhill.com,2010-02-09:Comment/344964892014-09-12T13:03:23Z2014-09-12T13:03:23Zcross site system-view tag issue<div><p>I added a conditional statement so the psuedo tags are only
applied to the include page and not other pages. It is working for
me now.</p>
<pre>
<code>#set ($pagename = $currentPage.name)
#if($pagename == "header")
[system-view:external]<img alt="Logo: Wesleyan University" src="/resources/images/${logoname}"/>[/system-view:external]
[system-view:internal]<img alt="Logo: Wesleyan University" src="${logopath}"/>[/system-view:internal]
#else
<img alt="Logo: Wesleyan University" src="${logopath}"/>
#end</code>
</pre></div>jvienneau