Skip to the content
Documentation

attribute_view_gui

No ratings yet

Summary

Outputs the view template for a content object attribute.

Usage

{attribute_view_gui attribute=attribute [ parameter=value [...] ]}

Parameters

Name Type Description Required
attribute object The target content object attribute. Yes.
parameters any Parameter(s) that will be passed to the included template. No.

Description

This function shows the view interface for a content object attribute. The attribute must be specified (as a "ezcontentobjectattribute" object) using the "attribute" parameter. All other parameters (of any type) will be passed on and thus become available as template variables in the included template.

Contributors

Comments (8 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. Exemple

    Stéphane ·

    Hello,
    It would be usefull to have an exemple on how to use parameter with attribute_view_gui function.
    Thank

    1. Re: Exemple

      Seth Gottlieb ·

      In your calling template you do something like:
      {attribute_view_gui attribute=$node.object.data_map.file link_text='Download'}
      Then in your attribute template you can access this variable by doing something like:
      {$link_text}

  2. Images

    Kristian Hole ·

    If you are displaying the image datatype (not objectrelation as the normal article class contains) you have the possiblility to set the size with image_class. Like this:
    {attribute_view_gui attribute=$node.object.data_map.myimage image_class='large'}
    Where the sizes are defined in image.ini.

  3. attribute_view_gui

    lixuefeng ·

    we know ,if we use this function .the system will insert a tag-<p> automatically! but i do not need this tag! but i want to display a object of XML.and i do not need <p>.so what i should do!?

    1. Re: attribute_view_gui

      xuefeng_lee ·

      i guess you mean is :you use "attribute_view_gui" to display a XML,but template in ez can insert a <p> tag automatically.but you do not need a <p>. that is a question ,let me have a think

    2. Re: attribute_view_gui

      nevens ·

      I was at first annoyed with this automatic feature, but I sort of 'tricked' it:
      created CSS and in belonging style class for this specific <p> tag, i set
      margin: 0px;
      this elegantly removed unnecessary space which <p> has by default.

  4. attribute_view_gui and shorten

    Toma ·

    How can i use attribute_view_gui and shorten, to have a limited output ?

    1. Re: attribute_view_gui and shorten

      Alimi Nabil ·

      Hi,
      You can't use attribute_view_gui with shorten operator. Depending of the datatype, having something like

      $your_attribute.content|shorten( 20...)

      should do. However, if you want to keep the attribute_view_gui mechanism, you might consider customizing the template invoked with the attribute_view_gui operator by copying it in your design folder-path. (content/datatype/view/ezstring.tpl for example).
      Therefore you can pass any parameters you want provided you handle it in the template.

Comments

Add a comment

Comments are read by a moderator before they appear.