Share » Forums » Setup & design » printable view

printable view

printable view

Wednesday 09 April 2008 7:48:53 am - 3 replies

Author Message

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 !

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu