This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Developer » EZP5 Getting content class attribute...

EZP5 Getting content class attribute names by identifier

EZP5 Getting content class attribute names by identifier

Thursday 20 June 2013 10:03:40 am - 1 reply


is it possible to get the names of a content class (not an object) attributes ?

For example:
<label>{{ getClass("my_class"blunk.gif }}</label>{{my_object.my_attribute}}

(I could do something like this in the controller if that's easyer)

Note that the class is not instantiated (i.e. I do not have a content, just a class name).
What I am trying to do is to have some kind of internationalisation in my bundle where the translations can be changed from the admin interface without having to change message.yml files.

Alternatively (and probably better): is it possible (in my bundle) to dinamically stuff data I fetch from e.g. SOAP into a content object of the desired class and pass that to the template ?



Monday 24 June 2013 10:28:27 am

To answer my own question:

you can get a contet type (in a controller) with:

$rep = $this->get('ezpublish.api.repository');
$cs = $rep->getContentTypeService();
$ct = $cs->loadContentTypeByIdentifier('customer');

But you do not get the attribute names in all defined languages, not only the one defined by the current locale. So it does not do what I wanted.


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

36 542 Users on board!

Forums menu

Proudly Developed with from