Pull Raw Content in the Form of HTML from Hippo CMS 12

71 views
Skip to first unread message

seth.p...@gmail.com

unread,
Nov 13, 2017, 2:58:26 PM11/13/17
to Hippo Community
Hello,

I am asking this question to see if it is possible to call a document explicitly as raw HTML from Hippo CMS. I suspect the answer is no, but I figured I would ask this question anyway for the sake of clarity. I have created the sample-document of Simple Document type within the content folder in Hippo, like so:

























I can call the document explicitly via the following URL: http://localhost:8080/site/content/simple-document.html. The end goal would be to pull in the raw HTML of said document, and ONLY the raw HTML of said document to rendered in a third party Grails Application. The expected output would be something along the lines of:

<!-- START MAIN CONTENT -->

<h3><a href="/site/content/sample-document.html">Lorem</a></h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has
roots in a piece of classical Latin literature from 45 BC, making it over 2000
years old. Richard McClintock, a Latin professor at Hampden-Sydney College in
Virginia, looked up one of the more obscure Latin words, consectetur, from a
Lorem Ipsum passage, and going through the cites of the word in classical
literature, discovered the undoubtable source. Lorem Ipsum comes from sections
1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and
Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of
ethics, very popular during the Renaissance. The first line of Lorem Ipsum,
"Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>

<!-- END MAIN CONTENT -->

For those who are familiar with IBM's Web Content Management (WCM), I would like to achieve the same functionality. I suspect that the answer to this question, if there even is one, would be either to create a new template, and or edit via Hippo's Console application:


























I have already tried editing the hst:renderpath property of the base-layout, and homepage-main templates, but to no avail. I have also tried manipulating some of the jsp's manually to just render the HTML of the document being called, but when I do that I lose some of the functionality of the Admin console in the cms webapp, more specially the Channel Editor. If any of you have any suggestions on how to achieve the aforementioned functionality I would greatly appreciate it.

Thanks Again, 

Seth Pletcher

Lucas Vossberg

unread,
Nov 13, 2017, 4:27:56 PM11/13/17
to Hippo Community
Hi Seth,

I think since the idea of a document in Hippo is more content-centric and by design separated from presentation something like a "raw" HTML of a document is not existing per se. My understanding is that you need to go all the way from sitemap to page to template to get your output:

Your hst:sitemap entry /content/sample-document.html for the document /content/sample-document should reference a page component via it's hst:componentconfigurationid. This page should _not_ have a hst:referencecomponent. Then you can add a hst:template to the page that only outputs the content of the referenced document. (Which the page´s componentclass needs to pass to the template.) Keep in mind that you can always have more than one sitemap entry for the same document: /content/sample-document.html might show the full page, while /raw/content/sample-document.html maps to a different page component that works in the way described above.

To turn this into a more generic solution to output the raw HTML of several documents with different structure you also need a generic sitemap entry and a generic template. The sitemap would use placeholders to map different documents to the same page. The page´s componentclass would pass the content of the different documents to the template. The template would need to use some form of generic algorithm to output the HTML of the different fields of the document.
You might want to look at the Content Blocks Plugin to build a document type with variable felds. I think it is a good basis for a generic output template:

Sorry if this has nothing to do with your question. If it does, feel free to ask for more details.

Hope this helps
Lucas

Jasper Floor

unread,
Nov 14, 2017, 3:52:09 AM11/14/17
to Hippo Community
As Lucas said, Hippo is content based. There is no "raw html" version of a document in a general sense. I suppose you could create a component that only uses one template, but as you stated it won't work in the Channel Manager (which is a more page based view of what is still a content based system). You could look into a rest service.

mvg,
Jasper

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-community@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.

Minos Chatzidakis

unread,
Nov 14, 2017, 5:08:30 AM11/14/17
to Hippo Community
Hi Seth,

What you're asking can be done out-of-the-box. All you have to do is use the componentrenderingurl [1] to get the partial html of a component. In the template of that component you can create any html you want.


hth!
Minos
--
--



Minos Chatzidakis

Product consultant

email-sig-logo.png

p.

e.

+31 20 522 44 66 

minos.ch...@bloomreach.com

_________________________________________________________________________________
Reply all
Reply to author
Forward
0 new messages