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.