printable view

Author Message

Fabien Scantamburlo

Wednesday 09 April 2008 7:48:53 am

Hi,

I'm trying to display a printable view of a node. I need this be neither a line view neither a full view.

My printable view use the print_pagelayout.tpl

I tried

<a href={concat('/layout/set/print/content/view/full/',$node.node_id)|ezurl} target="_blank">{"Print in friendly format"|i18n}</a>

But the node view full is returned.

I can't do

<a href={concat('/layout/set/print/content/view/print/',$node.node_id)|ezurl} target="_blank">{"Print in friendly format"|i18n}</a>

How can I call node view print ?

Thanks,

Fab.

Gaetano Giunta

Wednesday 09 April 2008 2:50:08 pm

In fact your second example is right.

The only problem is that you will have to do all the "print" view templates for your nodes/attributes: by default eZ Publish only ships with line and view templates (and a few others).

You can start copying the existing templates and modify them.
Start with design/standard/templates/content/datatype/view/* , design/standard/templates/content/datatype/attribute/view:* and Start with design/standard/templates/content/node/view/

Principal Consultant International Business
Member of the Community Project Board

Fabien Scantamburlo

Thursday 10 April 2008 6:58:49 am

What i want to do is easier, i think.

I have my own object class (e.g. news, as a <i>article</i> copy). For this class, i have my own view line and view full (as line/news.tpl and full/news.tpl)

I just need a new kind of view (as print/news.tpl)

I don't think i really need a print view for each datatypes. (or I hope to not have to)

Thanks,

Fab.

Fabien Scantamburlo

Thursday 10 April 2008 9:37:07 am

I found the solution :

An easy rewriting rule in override.ini.append.php :

[news_print]
Source=node/view/print.tpl
MatchFile=print/news.tpl
Subdir=templates
Match[class_identifier]=news

and called by :

<a href={concat('/layout/set/print/content/view/print/',$node.node_id)|ezurl} target="_blank">{"Print in friendly format"|i18n}</a>

That's it !

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.