Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

[community.invisionpower.com - pliki] Content Relational Records Field


Rekomendowane odpowiedzi

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.

Pobierz plik

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.