Forums / Setup & design / new embed in xml block

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

eZ debug

Timing: Jan 29 2025 13:47:16
Script start
Timing: Jan 29 2025 13:47:16
Module start 'content'
Timing: Jan 29 2025 13:47:16
Module end 'content'
Timing: Jan 29 2025 13:47:16
Script end

Main resources:

Total runtime0.1325 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.9219180.8516
Module start 'content' 0.00550.0060 768.7734106.6016
Module end 'content' 0.01150.1210 875.3750533.8594
Script end 0.1325  1,409.2344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00312.3727200.0002
Check MTime0.00120.9196200.0001
Mysql Total
Database connection0.00090.651910.0009
Mysqli_queries0.091168.71691410.0006
Looping result0.00110.84011390.0000
Template Total0.120691.010.1206
Template load0.00070.540210.0007
Template processing0.119990.482210.1199
Override
Cache load0.00050.399210.0005
Sytem overhead
Fetch class attribute can translate value0.00080.624610.0008
XML
Image XML parsing0.00020.149510.0002
General
dbfile0.00433.2467200.0002
String conversion0.00000.005430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs