Single page pointing to multiple content

29 views
Skip to first unread message

Robert van der Spek

unread,
Feb 23, 2017, 10:47:48 AM2/23/17
to Hippo Community
Here we go again :-). Using Hippo has quite a steep learning curve. I'm glad you guys are willing to lead me along the way.

Here's is an example to clarify my question:

An abstractpage:

<html>
   
<head>
       
<title><#if document.title??>${document.title}</title>
   
</head>
   
<body><@hst.include ref="body"></body>
</html>

A concrete page (I will call it concrete-page) extends the abstract page and defines the body ref:

<#list pageant as page>
   
<div><#if page.content??>${page.content}</div>
</#list>


the sitemap would supposedly look something like this:

+ hst:hst                                                                    [hst:hst]           
|   hst:configurations                                                       [hst:configurations]
|       + example                                                            [hst:configuration] 
|           + hst:sitemap                                                    [hst:sitemap]       
|               + concrete-page                                              [hst:sitemapitem]   
|                   - hst:componentconfigurationid = hst:pages/concrete-page                     
|                   - hst:refId = concrete-page                                                  
|                   - hst:relativecontentpath = ???                                              
+ content                                                                    [hippostd:folder]   
    + documents                                                              [hippostd:folder]   
        + example                                                            [hippostd:folder]   
            + headerdocument                                                 [hippo:handle]      
            + list-for-the-concrete-page                                     [hippostd:folder]   
                + concrete-something                                         [hippo:handle]      
                + concrete-anothert-hing                                     [hippo:handle]      

I would want a different relativecontentpatc for the abstract page and for the content page. I'd like to 'load' both 'headerdocument' and the folder 'list-for-the-concrete-page' as content. 

So finally here is the question: is this possible? And if yes: how? 

Thanks!

Lucas Vossberg

unread,
Feb 23, 2017, 3:14:44 PM2/23/17
to Hippo Community
Hi Robert,

how are your components/pages (abstract and concrete) defined? Could you also post that tree?
And where do you want to use the content from 'headerdocument'? Within the same "body ref" template? Or in some other component/template, that you're going to include into the final page?

A page is built from a hierarchy of components (with the page-node itself being the root component). All components can load individual documents from the repository and contribute to the final page. But if you need to pull content from several document nodes to _process_ within a _single_ template, from my understanding the data needs to be collected by a single component.

Lucas

Robert van der Spek

unread,
Feb 24, 2017, 2:11:40 AM2/24/17
to Hippo Community
Lucas Vossberg: 
how are your components/pages (abstract and concrete) defined? Could you also post that tree? 

Here it is, with the additional information: 
 
+ hst:hst                                                                    [hst:hst]                            
|   hst:configurations                                                       [hst:configurations]                 
|       + example                                                            [hst:configuration]                  
|           + hst:abstractpages                                              [hst:pages]                          
|           |   + base-layout                                                [hst:component]                      
|           |       - hst:template = template.base-layout                                                         
|           |       - hst:componentclassname = nl.example.components.PageheaderComponent                          
|           + hst:pages                                                      [hst:pages]                          
|           |   + concrete-page                                              [hst:component]                      
|           |       - hst:referencecomponent = hst:abstractpages/base-layout                                      
|           |       + body                                                   [hst:component]                      
|           |           - hst:template = template.concrete-page                                                   
|           |           - hst:componentclassname = org.onehippo.cms7.essentials.components.EssentialsListComponent
|           + hst:sitemap                                                    [hst:sitemap]                        
|               + concrete-page                                              [hst:sitemapitem]                    
|                   - hst:componentconfigurationid = hst:pages/concrete-page                                      
|                   - hst:refId = concrete-page                                                                   
|                   - hst:relativecontentpath = ???                                                               
+ content                                                                    [hippostd:folder]                    
    + documents                                                              [hippostd:folder]                    
        + example                                                            [hippostd:folder]                    
            + headerdocument                                                 [hippo:handle]                       
            + list-for-the-concrete-page                                     [hippostd:folder]                    
                + concrete-something                                         [hippo:handle]                       
                + concrete-anothert-hing                                     [hippo:handle]                       

The header document will be used within the base-layout template (the content from this document will only be used in the abstract page):

<html>
   
<head>
       
<title><#if document.title??>${document.title}</#if></title>

Lucas Vossberg

unread,
Feb 24, 2017, 3:45:44 AM2/24/17
to Hippo Community
You would use the "PageheaderComponent" to load the "headerdocument" node into the "document" variable. The EssentialsDocumentComponent is a good example how to do that [1]. It uses a component parameter to define the repository path to the document. You don't need the "relativecontentpath" in that case.

Lucas

[1] https://www.onehippo.org/library/setup/hst-components/document-component.html

Marijan Milicevic

unread,
Feb 24, 2017, 4:17:23 AM2/24/17
to hippo-c...@googlegroups.com
Hi,

On Fri, Feb 24, 2017 at 9:45 AM, Lucas Vossberg <voss...@exedra.de> wrote:
You would use the "PageheaderComponent" to load the "headerdocument" node into the "document" variable. The EssentialsDocumentComponent is a good example how to do that [1]. It uses a component parameter to define the repository path to the document. You don't need the "relativecontentpath" in that case.


I would also suggest to follow "getting started" trail [1] before we get into lengthy conversation explaining how things work and should work: 
it seems  you are developing something which is quite "Page oriented" and although you could make this work, this is not what we advocate (best practice)
If I were you I would take a step back, follow instructions ([1]) and look into examples [2] and also play with essentials [3]. 
My fear is, you'll end up being quite frustrated if you continue with trial error approach ( even before you attend our training ;-) )

cheers
mariijan
 


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

Reply all
Reply to author
Forward
0 new messages