new embed in xml block

Author Message

Torbjørn L.

Friday 11 February 2011 3:55:17 am

How can I create a new embed or paperclip in an xml block? I need to have three different ways of showing an article in a page depending on what the user wants.

So I need to specify what template goes with what embed. I can't find anything that talks about how to expand those options.

Any hints?

André R.

Friday 11 February 2011 8:54:29 am

You can add your own views, classes. And you can combine them with overrides.

Ref content.ini [embed] / [embed-inline] : AvailableViewModes[] / AvailableClasses[]

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Sébastien Antoniotti

Tuesday 15 February 2011 12:39:47 am

Hello,

I also want to do something similar I think:

After upload of an image into the ezoe, get a new "view mode" in the dropdown were we have by default "embed, embed-inline, full, line". This new view mode called "zoomable" by example will use a custom template in order to encapsulate the image into a link who will launch an jquery plugin.

So I have added this in my content.ini :

[embed]
AvailableViewModes[]=zoomable

I can now select "zoomable" into the ezoe, but on the frontoffice, the embed object is still called with the "embed" view mode : the $view variable into design/standard/templates/content/datatype/view/ezxmltags/embed.tp is always at "embed" and not at "zoomable"...

Any idea of something missing in my conf ? (I'm on 4.4)

Thanks !

eZ Publish Freelance
web : http://www.webaxis.fr

Marko Žmak

Wednesday 16 February 2011 12:53:06 am

Sebastien, some things to check:

  • when you re-edit the object is the view still set to "zoomable"?
  • did you add AvailableViewModes[]=zoomable to the content.ini in settings/override, or in content.ini of your admin siteaccess?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Torbjørn L.

Wednesday 16 February 2011 4:45:20 am

Andre - thanks for the quick reply. I'm sorry for my late one.

There doesn't seem to be any information regarding AvailableViewModes, so I'm not sure what this does.

AvailableClasses works like a charm, but now my embeds come out with a different wrapping class but still use the same embed template. I make som checks in my template based upon what classes come in, but would much rather create seperate templates for them.

Any hints on this?

Edit: It seems I can use classification as a match in override.ini to do what I want. So that it nice. Would still like to know what AvailableViewModes does.

ref:

[article_large_frontpage]
Source=content/view/embed.tpl
MatchFile=embed/article_large_frontpage.tpl
Subdir=templates
Match[classification]=article_large_frontpage

Where article_large_frontpage is listed as AvailableClasses[]=article_large_frontpage under [embed] in content.ini

Marko Žmak

Wednesday 16 February 2011 6:53:35 am

Torbjorn, the docs for AvailableViewModes is here:

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Configuration-files/content.ini/embed/AvailableViewModes

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Torbjørn L.

Wednesday 16 February 2011 7:03:39 am

Marko - yes, I've seen one of those. Didn't help me much though...:)

But from what I can see, it has nothing to do with what template will be used to render out the embed.

Sébastien Antoniotti

Wednesday 16 February 2011 8:03:10 am

"

Sebastien, some things to check:

  • when you re-edit the object is the view still set to "zoomable"?
  • did you add AvailableViewModes[]=zoomable to the content.ini in settings/override, or in content.ini of your admin siteaccess?
"

Hi Marko,

1) Yes, still to zoomable, but one thing is very strange : now I can't come back to "embed" or "embed-inline", they are present into the dropdown, I save the object with "embed" and when I re-edit he is still on "zoomable".

So I tried to remove all the AvailableViewModes[]=zoomable I added into the settings/override and the content.ini of my backoffice and the problem is different : no way to store my image with "embed-inline" of "full", the dropdown is still on "embed" now !!

eZ Publish Freelance
web : http://www.webaxis.fr

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 18 2025 02:52:05
Script start
Timing: Jan 18 2025 02:52:05
Module start 'layout'
Timing: Jan 18 2025 02:52:05
Module start 'content'
Timing: Jan 18 2025 02:52:06
Module end 'content'
Timing: Jan 18 2025 02:52:06
Script end

Main resources:

Total runtime1.3579 sec
Peak memory usage4,096.0000 KB
Database Queries76

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.0234152.6250
Module start 'layout' 0.00660.0029 741.648439.4531
Module start 'content' 0.00941.3471 781.1016694.0313
Module end 'content' 1.35650.0013 1,475.132820.7969
Script end 1.3579  1,495.9297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2563160.0002
Check MTime0.00140.1034160.0001
Mysql Total
Database connection0.00080.055810.0008
Mysqli_queries1.284894.6209760.0169
Looping result0.00080.0571740.0000
Template Total1.321297.320.6606
Template load0.00200.150820.0010
Template processing1.319297.149420.6596
Template load and register function0.00010.011010.0001
states
state_id_array0.00080.058510.0008
state_identifier_array0.00390.285120.0019
Override
Cache load0.00170.1286570.0000
Sytem overhead
Fetch class attribute can translate value0.00080.062140.0002
Fetch class attribute name0.00100.0737110.0001
XML
Image XML parsing0.00180.134840.0005
class_abstraction
Instantiating content class attribute0.00000.0018130.0000
General
dbfile0.00150.1096310.0000
String conversion0.00000.000540.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 10

Time used to render debug report: 0.0001 secs