tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/14638-include-contents-from-a-rendered-pageCascade CMS: Discussion 2016-10-02T02:45:11Ztag:help-archives.hannonhill.com,2010-02-09:Comment/405588542016-08-17T18:01:54Z2016-08-17T18:10:22ZInclude contents from a rendered page<div><p>Hi Jason,</p>
<p>If you can find a way to include contents from a rendered page
so that pages inside Cascade work properly with navs, then when
they are published, they should still work on your web server, and
there is no need of server-side file include. Are you trying to
move away from file include then?</p>
<p>Navs can be generated for separate sites from a single index
block existing in a shared site. Why file include in the first
place? In fact, I don't even need an index block to generate navs
at all. Using the Locator Tool to collect folder information, you
can generate them easily. You can also make the required
information available to the calling-page index block attached to
DEFAULT of a page and generate the nav in DEFAULT.</p>
<p>Contents rendered from a page region attached with a block and
format cannot be retrieved by the Locator Tool easily (I hope I am
right on this point). Assuming that what you mean by "nav files"
are in fact pages whose contents are generated in regions, then
there is no easy way to make the contents available to other pages.
There are ways, but difficult ones.</p>
<p>I hope this helps.</p>
<p>Wing</p></div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/405588542016-08-19T15:35:27Z2016-08-19T15:35:27ZInclude contents from a rendered page<div><p>We didn't want to write the navigation to each page, since when
people change their folder structure, they have to publish their
entire website. Because of this. there is a nav file in the root of
each department's folder. This is used as an include file once out
on the server. If someone changes their site structure, all they
have to do is it also publish the nav file, and the navigation
updates on every page of their site.</p>
<p>I suppose I could keep that nav file as is. But then use
internal tags to create the navigation for the pages within
cascade. I just do not know how to use the locator tool to tell
that page to render from the root of that department folder (nor
honestly do I know velocity). Trying to find some examples out
there on how to accomplish this</p>
<p>thanks</p></div>jeberweitag:help-archives.hannonhill.com,2010-02-09:Comment/405588542016-08-21T13:20:15Z2016-08-21T13:33:01ZInclude contents from a rendered page<div><p>Jason,</p>
<p>I have cooked up something for you. Here is a format to generate
a site menu:</p>
<p><a href="https://github.com/wingmingchan/velocity/blob/master/tutorials/05%20Cascade%20API/generate_menu.vm">
https://github.com/wingmingchan/velocity/blob/master/tutorials/05%2...</a></p>
<p>There are a few things you need to know about this format:</p>
<ol>
<li>It uses the Locator Tool. Check my site for the Cascade API
documentation.<br></li>
<li>I assume that every folder has an index page.<br></li>
<li>I did not use dynamic metadata to control the menu. You may
need to look at dynamic metadata on pages and folders to decide
whether to include an asset in the menu.<br></li>
<li>I used recursion and a number (<code>$level</code>) to control
how deep I want to go. You may need to manipulate this number, or
rewrite the macro to avoid the use of recursion.<br></li>
<li>You may not want to start from the Base Folder of a site. Then
you have to pick a starting folder.<br></li>
<li>The format must be made available to every page. You may want
to use web services to attach the format to pages.<br></li>
<li>You can use <code>[system-view:internal]</code> to make the
menu available only to Cascade.<br></li>
<li>I am still working on my Velocity tutorials. Check my site for
details.</li>
</ol>
<p>Wing</p></div>Wing Ming Chan