select

An article by Gaspard Bucher

insert a menu selector

  1. action
  2. ajax
  3. API
  4. classes
  5. common attributes
  6. conditions
  7. context
  8. dates
  9. display
  10. forms
    1. captcha
    2. checkbox
    3. form
    4. input
    5. new
    6. radio
    7. select
    8. textarea
  11. i18n
  12. meta
  13. SQLiss
  14. urls

insert a menu selector

  • label (true, false, t, dyn str) prefix with a label field.
  • root_class display the list of subclasses
  • without list of classes to omit (used with root_class)
  • root_class display the list of subclasses
  • nodes list of node ids or pseudo sql query
  • values literal comma separated values
  • attr node or class attribute to use (default: ‘id’ for Node and ‘name’ for class)
  • name parameter name (becomes node[xxx])
  • param raw parameter (not related to node[])
  • show node attribute to display (default: name) or values to display (when used with ‘values’)
  • tshow translated values to display
  • values list of values separated by commas
  • type (time_zone)
  • selected selected value
see input, label

select a value from a list

<r:select name='reason' values='failed,missed,sickness' selected='failed'/>

select a class

This is used when creating new objects.

<r:select name='klass' values='Project,Section' selected='Project'/>

select a parameter

This can be used to feed an ajax zone with a parameter (something that is not related to “node[]”).

<r:select param='rel' values='friend,husband,pet'/>

select from a list of nodes

<r:select name='icon_id' nodes='images in project' selected='main.icon_id'/>

value translation

You can translate the values to display (uses the current dictionary). This example would show options with value 1 showing as ‘english’, value 2 as ‘french’, etc.

<r:select name='foo' values='1,2,3' tshow='en,fr,de'/>

select a time zone

<r:select name='tz' type='time_zone'/>

select some attribute value

You can use a query to get values and use them inside the select. This can be used to have some “templates” for letters or replies:

<r:select name='text' nodes='letter_templates in site' attr='text' show='title'/>

In case you want to copy more then just a field, you might want to have a look at the “copy_id” special attribute (not documented here yet, write an email to the mailing list).