Output multiple files per asset?

burleigh's Avatar

burleigh

16 Nov, 2015 02:38 PM

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.

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:

1. Add a template that focuses on the content of the page (rather than head, foot and other blocks) .

2. Add a new output to the Config Set for these pages.

3. Add a new destination with transport for the new web server.

4. Edit the content type for these pages to enable the new output, aimed at the new destination.

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.

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...

Thanks!

  1. Support Staff 1 Posted by Tim on 16 Nov, 2015 02:56 PM

    Tim's Avatar

    Hi,

    You are on the right track with the steps you mentioned above.

    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...

    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).

    Let me know if you have any additional questions!

    Thanks

  2. 2 Posted by burleigh on 17 Nov, 2015 04:40 PM

    burleigh's Avatar

    Thanks for the quick affirm, Tim.

    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.

    Any truth to that conjecture?

  3. 3 Posted by Ryan Griffith on 19 Nov, 2015 04:25 PM

    Ryan Griffith's Avatar

    Hi,

    You are current in your explanation of the setup. Essentially, you will have a Template that looks something like the following:

    <!--#cascade-skip--><pass-through><system-region name="DEFAULT"/></pass-through>
    

    To summarize, the <pass-through> element within the Template will allow you to work around the "root node" requirement for valid XML, and the #cascade-skip will remove that element on render. Then, you surround the JSON content with a #protect-top 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.

    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.

    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.

    Please let me know if you have any questions.

    Thanks!

  4. 4 Posted by burleigh on 19 Nov, 2015 05:08 PM

    burleigh's Avatar

    Understood, thanks. It's been a while since I've mucked with XSL. ;-)

    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?

  5. 5 Posted by Ryan Griffith on 01 Dec, 2015 06:52 PM

    Ryan Griffith's Avatar

    Hi,

    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.

    Are there extensions in Cascade that I should know about before I begin?

    Aside from what you mentioned, nothing that I can think of.

    Please let me know if you have any questions.

    Thanks!

  6. Ryan Griffith closed this discussion on 22 Dec, 2015 07:56 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac