Jump to content


Welcome to DevFuse Forums


Sign In  Log in with Facebook

Create Account
Welcome to DevFuse Forums, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of DevFuse Forums by signing in or creating an account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get email updates
  • Get your own profile page and make new friends
  • Send personal messages to other members.
 
Guest Message by DevFuse

(View All Products)Featured Products

  • Donations


    Help fund your forum with donations, setup goals and track member donations. Offer rewards for members donating.
  • Timeslips


    Have your members submit their race times and share with others.
  • Videos


    Allows your members to submit their own videos for community viewing. Support is included for all the major video sites.
  • Forms


    Build your own forms for your members without coding experience. Support included for pm, email and topics.
  • Collections


    Build a community database of items for your members. Full features custom fields included.

Photo

[IPS] Content Relational Records Field


This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#1 News Bot

News Bot

    Dedicated Member

  • Members
  • PipPipPipPipPip
  • 1,909 posts
  • IP.Board Version:N/A

Posted 29 July 2012 - 12:22 AM

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.

View Resource