1.0 layout's - linked_fields

edited July 2012 in Feature Requests
Is it possible to link fields in 1.0 layouts?

Considering the following, how to link the title and permalink fields?

$home_layout->add_field('news', array( 'display_label' => false, 'repeatable' => true, 'add_extra' => false, 'type' => 'template', 'fields' => array( 'title' => array( 'label' => 'News title' ), 'permalink' => array( 'description' => 'This is the end of url for the news item.' ), 'excerpt' => array( 'description' => 'This is the succinct & very short version of the text displayed on the home page.' ), 'story' => array( 'label' => 'Full story', 'type' => 'textarea' ) ) ) );

Comments

  • edited July 2012
    Doesn't look like it's working correctly. I'll take a look at it to see if it is an easy fix. Ideally, you should be able to do something like this:
    $fields['title'] = array('type' => 'linked', 'linked_to' => 'name');
  • edited 4:49AM
    I just posted a fix for you to try out on the 1.0 branch.
  • edited 4:49AM
    Getting a JS error in console:

    Timestamp: 16/07/12 7:36:55 PM Error: missing ) in parenthetical Source File: http://www.sitename.com/fuel/modules/fuel/assets/js/jquery/jquery.js?c=943873200 Line: 636, Column: 27 Source Code: ("vars--news[0][permalink]""vars--news[0][title]""vars--news[1][permalink]""vars--news[1][title]""vars--news[2][permalink]""vars--news[2][title]""vars--news[3][permalink]""vars--news[3][title]")
  • edited 4:49AM
    I wasn't quite seeing that js error but I think I may know what was causing it. I've posted some additional fixes for that to account for the nested repeatable fields. Please test on your end and let me know of any other additional issues.
  • edited 4:49AM
    All working with the latest pull!
Sign In or Register to comment.