Include contents from a rendered page
Hi There,
All of our sites use a common index block and xslt to render an
unordered list for a nav file. This file is then used as an include
for the website.
We use a common index block so one does not need to be created for
every department folder (we have over 300 department folders).
This index block starts at the nav file in a root folder, and
indexes everything within.
The issue is that we cannot see the rendered nav file within any page inside Cascade (since it is an include file on the server).
I'm thinking that we need to use velocity to show the contents
of the nav file within the folders pages.
Locator tool?
I'm brand new to velocity, so am unsure as how to accomplish
this.
thanks for any help you can provide
-Jason
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
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
1 Posted by Wing Ming Chan on 17 Aug, 2016 06:01 PM
Hi Jason,
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?
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.
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.
I hope this helps.
Wing
2 Posted by jeberwei on 19 Aug, 2016 03:35 PM
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.
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
thanks
3 Posted by Wing Ming Chan on 21 Aug, 2016 01:20 PM
Jason,
I have cooked up something for you. Here is a format to generate a site menu:
https://github.com/wingmingchan/velocity/blob/master/tutorials/05%2...
There are a few things you need to know about this format:
$level
) 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.[system-view:internal]
to make the menu available only to Cascade.Wing