How to display multiple documents under the same page

147 views
Skip to first unread message

Gangel Dávid

unread,
Jul 31, 2015, 8:59:03 AM7/31/15
to Hippo Community
Hi,

I would like to display multiple content on the same page.
Let's say I have the following content structure:
Root
   - Translated folder1
       - Simple Document1
   - Translated folder2
        - Simple Document2
   - Simple Document3

AFAIK under one sitemapitem I can reference one relative content path.
Now with this example how would I be able to display all the documents under the same page(ie. url)

Thank you.

Tobias Jeger

unread,
Aug 3, 2015, 3:13:55 AM8/3/15
to hippo-c...@googlegroups.com
Hi David,

I don't really get your use case. If you show multiple documents under the same URL, it is supposed to be some kind of overview page? If not, it seems to me that "internal" links to some or all of these documents wouldn't work, because not each document has its own URL.

To show multiple documents on a single page, you could point the URL's sitemap item's relativeContentPath to one of your documents, and load the other documents during he HstComponent's doBeforeRender method, using relative paths to the other documents, or HST queries.

cheers

Tobi


--
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-c...@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-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 101 Main Street, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

Gangel Dávid

unread,
Aug 3, 2015, 5:47:21 AM8/3/15
to Hippo Community
Hi Tobi,

Yes it should be an overview page.

Gangel Dávid

unread,
Aug 3, 2015, 9:17:57 AM8/3/15
to Hippo Community
Hi,

after a bit thinking of the problem, and did some research I ended up with the following 2 documentations:

Related to this I think I'm confident enough about database schema design therefore I would like to know what are the Keys and Foreign keys in the context of content type editor?

Thank you.

Gangel Dávid

unread,
Aug 4, 2015, 10:21:49 AM8/4/15
to Hippo Community
Hi,

I did plan a basic relational DB model. Find in attachment
My question would be that can I use the same model with defining my own document types and linking the things together?
Would it be efficient and does not violates the rules described the articles?

Thank you.
model.png

Gangel Dávid

unread,
Aug 5, 2015, 3:18:47 AM8/5/15
to Hippo Community
After reading this article:

I feel I need to re-think this stuff.

Olivier Bourgeois

unread,
Aug 5, 2015, 4:33:34 AM8/5/15
to hippo-c...@googlegroups.com

Hi Dávid,

indeed JCR is a hierarchical database and not relational, therefore things such as join tables and foreign keys are not easily done in JCR. The closest thing you can do is link a document to 1..N documents using the Docbase type in the editor. But abusing this kind of links leads to hard to navigate structures, and also you don’t have any checks for referential integrity.

So you should try to denormalize your schema as much as you can. For instance, you can bring the Features in the Service document using a multi-select field that is populated from a value list.

Regards,
Olivier.

Gangel Dávid

unread,
Aug 5, 2015, 6:09:05 AM8/5/15
to Hippo Community
AFAIK linking together 2 document can be done as you said based on docbase and with built in compund type link.
I know that with link you get the benefit of:
A Link field is used to create an internal link to a different content item (such as a document or asset) in the repository. It is stored as a reference to the actual JCR node in which that content item is stored. The delivery tier will resolve the reference and transalte it to a website URL on-the-fly. If a CMS user tries to delete the referenced content item they will see a warning that it is being referred to and deleting the item will cause a broken link in the refering document.


But this is a compound type. Am I going to have issues if I would use it like described in the best practice documentations? Or as it's not a custom compound it's not valid for that.

Olivier Bourgeois

unread,
Aug 5, 2015, 7:09:27 AM8/5/15
to hippo-c...@googlegroups.com
On Wed, Aug 5, 2015 at 12:09 PM, Gangel Dávid <gan...@gmail.com> wrote:
AFAIK linking together 2 document can be done as you said based on docbase and with built in compund type link.
I know that with link you get the benefit of:
A Link field is used to create an internal link to a different content item (such as a document or asset) in the repository. It is stored as a reference to the actual JCR node in which that content item is stored. The delivery tier will resolve the reference and transalte it to a website URL on-the-fly. If a CMS user tries to delete the referenced content item they will see a warning that it is being referred to and deleting the item will cause a broken link in the refering document.

True, we also have this kind of checks when you unpublish a document, but this is done at the application level. In your own code (in a migration script for instance), you can delete those nodes and the repository will not tell you that you are violating a constraint like a RDBMS would for a foreign key.


But this is a compound type. Am I going to have issues if I would use it like described in the best practice documentations? Or as it's not a custom compound it's not valid for that.

You won't have issues with the Docbase compound or Resource because since they are built in the CMS can handle them properly.

The thing is that if you abuse this kind of links, it gets hard for the end user to have an overview of the final document, but you have better reuse of content. If you put everything as properties of the document, the end user have a better overview, but you will have duplicated content.

So there's a trade-off here between usability and maintenance: I'd say you should experiment with different models to see what works best for your use case.

Gangel Dávid

unread,
Aug 5, 2015, 9:01:50 AM8/5/15
to Hippo Community
Hi,

Okay, thank you for clarification.
My last question is regarding to the Selections plugin. I think it can solve my features stuffs greatly.
The only thing that I don't really get is how it does handle the translations?
I mean I can have a value list. In this list I'm defining key-value pairs.
Now as this ill be displayed in the custom type I would choose english.
But when creating a new document which is a type of the custom type how can I also translate the options?

Thank you.

Gangel Dávid

unread,
Aug 5, 2015, 12:44:01 PM8/5/15
to Hippo Community
I mean displaying the translated version of values on the site.

Olivier Bourgeois

unread,
Aug 6, 2015, 5:02:49 AM8/6/15
to hippo-c...@googlegroups.com
Hi Dávid,

   you have to declare a Spring bean in your site module, then you have a utility class that comes with the plugin and that you can use in your component(s) to retrieve the value list document and put it on the request. Finally, in your JSP/Freemarker you can access the values using a HashMap addressing style:

${cities[document.city]}

See here for all the details:


Regards,
Olivier.

Gangel Dávid

unread,
Aug 7, 2015, 4:50:50 AM8/7/15
to Hippo Community
Hi,

Okay now I see how it has translation support. Thank you.
I don't see anywhere in the documentation that inside the Essential webapp when you select the selections plugin, it has another tab where you can select from your lists which one you would make it available for the site.
Are there any special reasons why is not included or I can use it?

Tobias Jeger

unread,
Aug 7, 2015, 6:40:33 AM8/7/15
to hippo-c...@googlegroups.com
Hi David,

if your question is:

In Essentials' Selections configuration tool, I see all my translated variants of a value list; which one(s) do I need to make available through the ValueListManager and how?

then, I guess it would be sufficient to make one of the translations (doesn't matter which one) available through the ValueListManager. Your HstComponent can then get that value list and from it, switch to the appropriate translation/locale. I agree that this configuration screen leaves room for improvement with regards to the fact that value lists can be translated.

HTH

Tobi

Gangel Dávid

unread,
Aug 7, 2015, 6:46:38 AM8/7/15
to hippo-c...@googlegroups.com
Nop.
My question is just that can be the other tab in essential to be used to setup the same thing as described in the documentation, or there are some issues and that's why this option is missing from the docs.

You received this message because you are subscribed to a topic in the Google Groups "Hippo Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hippo-community/TiRyMgVs5jk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hippo-communi...@googlegroups.com.

Tobias Jeger

unread,
Aug 7, 2015, 8:02:12 AM8/7/15
to hippo-c...@googlegroups.com
Yes, Essentials can setup the spring config for you. The documentation [1] says:

"The setup application provides a UI to make value lists available to the site application, by means of the ValueListManager Spring bean."

Were you looking for more text or a screenshot?


Reply all
Reply to author
Forward
0 new messages