liam_davison
I'm new here

Creating Document Groups for specific Presentation channels (PDF)

Jump to solution

Hello,

I am experimenting with Document Groups, as I would like to be able to create PDFs combining several different pages. I created a test group with 3 pages, and generated both HTML and PDF channels.

The HTML version worked, and combined all three pages into a single HTML file (the layout was not appropriate, of course, but that's OK for my test).

The PDF version only contained the contents of a single page, the first on the list.

Is there something else I need to do set up a working document group for the PDF channel? Do I need to change my PDF channel template - the FOP code might not be able to join together separate PDFs? As I still need to use the PDF channel to create normal single-page PDFs, are there API calls to distinguish between page generation and document group generation?

I think I need a better explanation of what the 'Start template', 'End template' and 'Template end' fields mean.

Many thanks,

Liam

0 Kudos
1 Solution

Accepted Solutions
liam_davison
I'm new here

I have solved my problem. It is necessary to split the templates into three templates - the header, the body and the footer.

There is a #global.docgroup invocation to identify if the page is being generated as part of a Document Group. The "comment" in the Document Group can be used as an overall page title, though I haven't found out how to access the comment in the template yet.

I'll need to build my own ContentCreator UI in order to provide access to Document Groups in the CC Smiley Sad.

Liam

View solution in original post

0 Kudos
5 Replies
liam_davison
I'm new here

I have solved my problem. It is necessary to split the templates into three templates - the header, the body and the footer.

There is a #global.docgroup invocation to identify if the page is being generated as part of a Document Group. The "comment" in the Document Group can be used as an overall page title, though I haven't found out how to access the comment in the template yet.

I'll need to build my own ContentCreator UI in order to provide access to Document Groups in the CC Smiley Sad.

Liam

0 Kudos

Hello Liam,

did you answer your question by yourself (as you write you solved your problem) or do you need further help with this posting? If so could you describe your remaining problem?

Best regards

Michaela

0 Kudos

Hello Michaela,

My only question is the Document Group comment field available to use in templates? $CMS_VALUE(#docGroup.comment)$ (or #docGroup.getComment()) doesn't return any value.

Thanks,

Liam

0 Kudos

In fact, I have losts of questions about $CMS_VALUE(#docGroup) - I really need to be able to access the underlying PageRef but can't get at it.

#docGroup.childs returns a list of PageRefWrappers (not mentioned in the API documentation). But when I look at the DocumentGroup in the Beanshell console, the children of the DocGroup are all DocLinks.

Here is a simplified version of my table-of-contents:

$CMS_SET(renderChapter)$

  $CMS_FOR(chapter,chapters)$

<li>

  $$CMS_VALUE(chapter.index +1)$ : $CMS_VALUE(chapter.getTarget(true))$

  $CMS_IF(!chapter.label.isEmpty())$

      $CMS_VALUE(chapter.label.convert2)$

  $CMS_ELSE$

    **unknown chapter**

  $CMS_END_IF$

</li>

  $CMS_END_FOR$

$CMS_END_SET$

$CMS_SET(chapters,#docGroup.childs)$

$CMS_VALUE(renderChapter)$

$CMS_VALUE(chapter.getTarget(true))$ returns null.

$CMS_VALUE(chapter.label)$ is not suffient for my needs. I need access to the PageRef in order to build my table of contents.

How can I get the PageRefs from a #docGroup in a page template?

Many thanks,

Liam

0 Kudos

Hi Liam,

#docGroup.childs returns a list of PageRefWrappers (not mentioned in the API documentation).

You can use "chapter.node" to get the PageRef, but it's not guaranteed to be available in future versions.

Please file a dedicated feature request to get a stable API for this.

Peter

Peter
0 Kudos