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.

eZ debug

Timing: Jan 19 2025 12:42:43
Script start
Timing: Jan 19 2025 12:42:43
Module start 'layout'
Timing: Jan 19 2025 12:42:43
Module start 'content'
Timing: Jan 19 2025 12:42:45
Module end 'content'
Timing: Jan 19 2025 12:42:45
Script end

Main resources:

Total runtime1.6127 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 589.0313152.6094
Module start 'layout' 0.00490.0040 741.640639.4297
Module start 'content' 0.00901.6022 781.0703559.4063
Module end 'content' 1.61120.0014 1,340.476612.1953
Script end 1.6126  1,352.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.1774160.0002
Check MTime0.00120.0728160.0001
Mysql Total
Database connection0.00070.045110.0007
Mysqli_queries1.551696.2135600.0259
Looping result0.00070.0428580.0000
Template Total1.573897.620.7869
Template load0.00230.141720.0011
Template processing1.571597.445220.7857
Template load and register function0.00010.006910.0001
states
state_id_array0.00130.081910.0013
state_identifier_array0.00160.098420.0008
Override
Cache load0.00180.1097370.0000
Sytem overhead
Fetch class attribute can translate value0.00050.032120.0003
Fetch class attribute name0.00190.119860.0003
XML
Image XML parsing0.00250.153820.0012
class_abstraction
Instantiating content class attribute0.00000.001180.0000
General
dbfile0.00250.1566220.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs