Converting HTML Block content into publishable page content
At the 2015 Cascade User Conference I saw a lot of schools implementing a page element in place of an html block for easy site-wide edits and publishes. Our current main navigation, footer, and search bar are block elements but we have a few edits coming down the pike and I thought it'd be easier to have this content as a page so we only have to publish the page rather than our entire website to carry out the changes.
Where would be a place to start with something like this? Are there problems with implementing an idea like this?
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 graham.lewis on 31 Mar, 2016 07:50 PM
Matthew,
When I was at JSU, we did this exact thing. http://www.jsu.edu/
On this page, the header and footer are both Server Side Includes.
What we did was create a basic "include page type" (template with one region, config set, content type) that we would add which ever block we wanted to act as an include. We will use the Header as an example.
Then inside the main template we would add something like this:
What this does is shows the Cascade Block within the system and uses the Include Page that you created when viewing the live page.
You would need to make sure that includes were able to display on your web server.
Doing it this way, all you would need to do after updating your header block would be to publish out that Header Include Page.
2 Posted by matthew.wren on 31 Mar, 2016 08:41 PM
This is exactly what I'm looking for! Now can you help me with the idea of the
path to include
? My original thought is to create a super simple html page that only contains ournavigation
html block. That way, when we make a change to the block, it will also be represented in the page.My first idea is to have a page with only one region and placed the HTML block in with no format but I don't think that is working...
Is there a way to write a format that just pulls that block's content or is there a simplier way?
3 Posted by graham.lewis on 31 Mar, 2016 08:54 PM
Not a problem - for the "path to include" part, this is what the JSU one looks like:
I am also attaching a screenshot so you can see how that looks inside of Cascade.Also, as far as the template region, you should just be able to attach the block to the default region. We didn't have a format or anything assigned to it since we were using XHTML Blocks.
Does that answer your questions?
4 Posted by matthew.wren on 01 Apr, 2016 02:34 PM
I feel like I'm on the right track. I have to page made with only one region and the block is in place but it's not being included on the page. I checked the page for the navigation and I just get a 404 error so I'm not sure why that won't publish. I also tried to just include a straight HTML file into the template but that also didn't work.
I'm also not certain PHP is working so I'll have to contact our systems guys to find out what's up with that. Is there another solution incase our server doesn't have PHP for some reason?
5 Posted by graham.lewis on 01 Apr, 2016 02:40 PM
You need to make sure that PHP Includes are enabled on the server. Once that is done it should work.
If you are getting a 404 then it could be that the include page itself didn't publish so double check that it is publishing.
You could also try using
<!--#include virtual="/path/to/include.html" -->
6 Posted by matthew.wren on 04 Apr, 2016 07:57 PM
I think i solved the page publishing issue. The only thing left I believe is the PHP snippet that's holding me up.
Here's what I have in my template:
The page looks fine in the CMS but the nav doesn't publish outside of it.The page is published but I'm doing all of this work in a dev server so would that have anything to do with it?
7 Posted by graham.lewis on 06 Apr, 2016 04:31 PM
Matthew,
Sorry for the delay, can you send me a link to view it online?
8 Posted by matthew.wren on 10 May, 2016 01:27 PM
Hey Graham,
Sorry for leaving you hanging so long!
I played with this a lot over the last couple days and I found that this worked better than the php solution
<!--#include virtual="/path/to/include.html" -->
I'm currently still playing around with this but so far it seems to work just fine! Thanks for your help with this!
9 Posted by matthew.wren on 10 May, 2016 01:52 PM
One last thing,
I've been thinking about applying this to not only our navigation but other globally shared items like the footer, header-text, and even our analytics code. Is there any inherent downside to using this method for items such as this?
10 Posted by Penny on 18 May, 2016 04:55 PM
Hi Matthew,
I can't think of anything but that links need to be absolute for content in things like the header and footer. Because the link will need to work from anywhere in your site. The link rewriting is the only thing that I have come across as a potential issue. But i address that using absolute links and maintaining my includes in a separate site.
Tim closed this discussion on 15 Jun, 2016 12:56 PM.
matthew.wren re-opened this discussion on 15 Jun, 2016 04:57 PM
11 Posted by matthew.wren on 15 Jun, 2016 04:57 PM
Hey again,
I'm going through the implementation process and everything works. I'm just seeing an odd occurrence when using this for my head tags/scripts. It'll add an opening and closing
div
container around the stylesheets & scripts.So instead of
it'll show
Is there a way I can preserve the code as is without it adding
div
s around the include? It doesn't appear to break the page but I don't want to have strange syntax in my<head>
if I don't need it.12 Posted by matthew.wren on 16 Jun, 2016 05:02 PM
I found the solution to my issue. After I removed the div from the template the code was disappearing causing more issues so I wrapped the metadata and the stylesheets with
<!--#START-ROOT-CODE
and#END-ROOT-CODE-->
I also notice because of the
CDATA
within my javascript link was causing some issues so here's the code I finished that seems to have solved the problem13 Posted by graham.lewis on 16 Jun, 2016 07:46 PM
Sorry for the delayed response - glad you found a solution!
If you need anything else, let me know!
--
Graham Lewis
Sales Engineer, Hannon Hill
p. 678.904.6900 X-116
w. www.hannonhill.com
e [email blocked]
<http://www.facebook.com/HannonHillCorp> <https://twitter.com/hannon_hill>
<https://www.linkedin.com/pub/graham-lewis/6/228/864>
<https://instagram.com/hannonhill/>
14 Posted by matthew.wren on 17 Jun, 2016 03:20 PM
I'm having trouble with an HTML block contain within publishable page. Below is our navigation block. I attach it to the default region on what I'm calling a widget. The search bar displays but the navigation seems to disappear. I tried using
<--#protect... ...#protect-->
and other code sections but then the navigation doesn't behave properly. specifically with dropdown behavior and proper links.Is there a way i can ensure the navigation is preserved as the widget publishes?
15 Posted by graham.lewis on 17 Jun, 2016 03:37 PM
Matthew,
Can you send me a link to this live? That way I can take a look at it.
Sent from my iPhone
16 Posted by matthew.wren on 17 Jun, 2016 03:55 PM
Here's the link directly to the widget. Looking at the source code it omits the navigation entirely.
Here's a page with the widget applied. The search bar exists but no navigation.
17 Posted by graham.lewis on 20 Jun, 2016 03:53 PM
I did and am looking into it this am
--
Graham Lewis
Services Developer, Hannon Hill
p. 678.904.6900 X-116
w. www.hannonhill.com <http://www.hannonhill.com/>
e [email blocked] <mailto:[email blocked]>
<http://www.facebook.com/HannonHillCorp> <https://twitter.com/hannon_hill> <https://www.linkedin.com/pub/graham-lewis/6/228/864> <https://instagram.com/hannonhill/>
18 Posted by graham.lewis on 20 Jun, 2016 03:57 PM
Matthew,
Sorry for the delay - did you say this works internally just not when
published?
--
Graham Lewis
Sales Engineer, Hannon Hill
p. 678.904.6900 X-116
w. www.hannonhill.com
e [email blocked]
<http://www.facebook.com/HannonHillCorp> <https://twitter.com/hannon_hill>
<https://www.linkedin.com/pub/graham-lewis/6/228/864>
<https://instagram.com/hannonhill/>
19 Posted by matthew.wren on 20 Jun, 2016 04:02 PM
Yes, it is omitting the html on publish
20 Posted by graham.lewis on 20 Jun, 2016 04:03 PM
Ok - got ya. I'll look into it!
--
Graham Lewis
Sales Engineer, Hannon Hill
p. 678.904.6900 X-116
w. www.hannonhill.com
e [email blocked]
<http://www.facebook.com/HannonHillCorp> <https://twitter.com/hannon_hill>
<https://www.linkedin.com/pub/graham-lewis/6/228/864>
<https://instagram.com/hannonhill/>
21 Posted by graham.lewis on 20 Jun, 2016 04:04 PM
Can you paste the entire format and/or into here?
--
Graham Lewis
Services Developer, Hannon Hill
p. 678.904.6900 X-116
w. www.hannonhill.com <http://www.hannonhill.com/>
e [email blocked] <mailto:[email blocked]>
<http://www.facebook.com/HannonHillCorp> <https://twitter.com/hannon_hill> <https://www.linkedin.com/pub/graham-lewis/6/228/864> <https://instagram.com/hannonhill/>
22 Posted by matthew.wren on 21 Jun, 2016 01:11 PM
It's just a page with the navigation block attached. For whatever reason the search bar is fine but it fails to include the navigation. I've attached the block content earlier. As soon as I view the page it just display the search bar and the nav disappears. I know the code is there but it's just not including it on the widget page. I tried several code block protections but then it displays the URLs literally so it no longer has the internal linking.
I've used the same content in a velocity script and having the same results. Is there something else I can provide you to help me out? there's not a whole lot to share.
23 Posted by graham.lewis on 21 Jun, 2016 01:44 PM
Try switching it to an XML block - it's possible that the WYSIWYG is messing with the code.
Tim closed this discussion on 13 Jul, 2016 05:41 PM.