Перейти к содержимому


Фотография

Content Relational Records Field


  • Авторизуйтесь для ответа в теме
В этой теме нет ответов

#1 Оффлайн   IpbZona Bot

    Пользователь


  • Пользователи
  • Репутация
    1
    • Cообщений: 29

Отправлено 29 Июль 2012 - 10:22

This Hook and field source will add a single IP.Content field type that is an advanced usage database relational field.
The selected field to use will be used for input only, the value of this field is always an ARRAY of 'record' data, you should NEVER select to show this field in listing or display and manually show the data you wish to show in the templates, as such, there is no field preview available.
You should never use this as a title or body field. You should never use this field's topic posting options.
If the selected field input type is a drop-down, the value will be a single-dimensional array of 'record' data from the selected 'record' with all other field types parsed, the field data there-of, the category(if any) data, and the data of the database pulled.
If the selected field input type is not a drop-down, the value will be a multi-dimensional array of 'records' data from the selected 'records' with all other field types parsed, the field data there-of, the category(if any) data for each record, and the data of the database pulled.
Available field input types are drop-down, multi-select, type-ahead, and check-box.
Check-box is designed In a Show/hide set of h3 tags and div's, will be the database name if no categories are present in the selected relational database in one header, will be grouped by the category name of the records to pull if categories are used in the selected relational database.
All Check-box div's default to not-expanded(hidden) to keep the form clean, and open with a click on the header.
With a drop-down in use, display template code could look like this:
<if test="$data['record']['myfieldkey']">
<a href="{$data['record']['myfieldkey']['record_link']}">{$data['record']['myfieldkey']['record_title']}</a>
</if>With a multi-select, type-ahead, or check-box in use, display template code could look like this:
<if test="is_array($data['record']['myfieldkey']) && count($data['record']['myfieldkey'])">
<foreach loop="$data['record']['myfieldkey'] as $id => $recordData">
<a href="{$recordData['record_link']}">{$recordData['record_title']}</a>
</foreach>
</if>record_title is the field that was selected for input's value.

Пожалуйста Войдите или Зарегистрируйтесь чтобы видеть скрытое содержание



Заработок и обучение заработку