tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/20492-output-multiple-files-per-assetCascade CMS: Discussion 2015-12-22T19:56:16Ztag:help-archives.hannonhill.com,2010-02-09:Comment/384724842015-11-16T14:38:46Z2015-11-16T14:38:47ZOutput multiple files per asset?<div><p>Hello, Cascade crew! We are developing a new website in parallel
to managing an older one. Static, file-based shtml pages have been
migrated manually to our new Cascade instance, but we also have a
bunch of bio pages in a different Cascade server that maintains
part of our old site. These pages use a complex data definition and
template, and build several outputs, including shtml files. Because
the new site will organize that content differently both within
pages and across directories, and because time is a factor, I'd
like to migrate these documents to our new Cascade instance
later.</p>
<p>That means to me that I need to cause the old Cascade server to
output an additional shtml (or maybe JSON) file based on a
different template to a different web server. I think I can do that
this way:</p>
<ol>
<li>
<p>Add a template that focuses on the content of the page (rather
than head, foot and other blocks) .</p>
</li>
<li>
<p>Add a new output to the Config Set for these pages.</p>
</li>
<li>
<p>Add a new destination with transport for the new web server.</p>
</li>
<li>
<p>Edit the content type for these pages to enable the new output,
aimed at the new destination.</p>
</li>
</ol>
<p>Is my thinking clear on this? There's also the matter of the
index to these pages, but I'll leave that as a separate matter.</p>
<p>Assuming my thinking is on the right path, it would also be nice
if I could "flatten" the directory structure that now organizes
these pages. Can anything along this page accomplish that? I could,
I suspect, also accomplish that on the server. But if Cascade can
do it...</p>
<p>Thanks!</p></div>burleightag:help-archives.hannonhill.com,2010-02-09:Comment/384724842015-11-16T14:56:04Z2015-11-16T14:56:04ZOutput multiple files per asset?<div><p>Hi,</p>
<p>You are on the right track with the steps you mentioned
above.</p>
<blockquote>
<p>Assuming my thinking is on the right path, it would also be nice
if I could "flatten" the directory structure that now organizes
these pages. Can anything along this page accomplish that? I could,
I suspect, also accomplish that on the server. But if Cascade can
do it...</p>
</blockquote>
<p>Cascade is going to publish the asset structure exactly the way
it is within the CMS. So, in order for you to have a 'flattened'
directory structure, you'd need to move all of the assets in
Cascade into one directory, then publish them from there. It sounds
like that probably won't be possible in your case since the assets
are still in use on your old instance (for the time being).</p>
<p>Let me know if you have any additional questions!</p>
<p>Thanks</p></div>Timtag:help-archives.hannonhill.com,2010-02-09:Comment/384724842015-11-17T16:40:52Z2015-11-17T16:40:52ZOutput multiple files per asset?<div><p>Thanks for the quick affirm, Tim.</p>
<p>And I do have a followup question. Threads here on JSON are
several years old. Could you nudge me toward the best technique for
making the JSON? I believe that my template will emit XML, and that
I want a format block to transform that into JSON. My hesitation to
start is simply that the "new output" dialog makes JSON a first
class citizen, so I imagine Cascade my have "helpers" now for this
purpose that it didn't have when those forum threads were
written.</p>
<p>Any truth to that conjecture?</p></div>burleightag:help-archives.hannonhill.com,2010-02-09:Comment/384724842015-11-19T16:25:52Z2015-11-19T16:25:52ZOutput multiple files per asset?<div><p>Hi,</p>
<p>You are current in your explanation of the setup. Essentially,
you will have a Template that looks something like the
following:</p>
<pre>
<code><!--#cascade-skip--><pass-through><system-region name="DEFAULT"/></pass-through></code>
</pre>
<p>To summarize, the <code><pass-through></code> element
within the Template will allow you to work around the "root node"
requirement for valid XML, and the <code>#cascade-skip</code> will
remove that element on render. Then, you surround the JSON content
with a <code>#protect-top</code> code section within your Format,
so the content will be rendered to the very top of the output,
resulting in a plain text file being generated.</p>
<blockquote>
<p>My hesitation to start is simply that the "new output" dialog
makes JSON a first class citizen, so I imagine Cascade my have
"helpers" now for this purpose that it didn't have when those forum
threads were written.</p>
</blockquote>
<p>The setup is exactly the same. The JS, JSON and CSS output types
you are referring to are only used by Cascade during page render so
it knows that is needs to serve the pages using the correct MIME
type. This allows you to do things like load a page's JSON output
suing AJAX from within Cascade and have it be rendered
correctly.</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/384724842015-11-19T17:08:42Z2015-11-19T17:08:42ZOutput multiple files per asset?<div><p>Understood, thanks. It's been a while since I've mucked with
XSL. ;-)</p>
<p>xsl:version says that our institution's Cascade server (7.14.1)
is using XALAN, and supports XSL 1.0 and XPATH 1.0. IIRC those are
about 15 year old specs. Are there extensions in Cascade that I
should know about before I begin?</p></div>burleightag:help-archives.hannonhill.com,2010-02-09:Comment/384724842015-12-01T18:52:34Z2015-12-01T18:52:34ZOutput multiple files per asset?<div><p>Hi,</p>
<p>You are correct, we are using XSL 1.0. There are plans for
upgrading in the future; however, there is no immediate timeline
for the upgrade due to the potential impact of such an upgrade.</p>
<blockquote>
<p>Are there extensions in Cascade that I should know about before
I begin?</p>
</blockquote>
<p>Aside from what you mentioned, nothing that I can think of.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffith