Jump to content

Search the Community

Showing results for tags 'fieldsetpage'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 2 results

  1. In my code, I create all the fields I want included in the FieldsetPage - all good. I then create my FieldsetPage field and it appears in the Admin->Fields list - seems all good. $fields = wire('fields'); if(!$fields->get("name=widget_title")) { $field = new Field; $field->type = $modules->get("FieldtypeText"); $field->name = "widget_title"; $field->label = $this->_("Message Title"); $field->description = $this->_("Max length 64 characters."); $field->maxlength = 64; $field->stripTags = true; $field->tags = "widget"; $field->set('showCount', InputfieldText::showCountChars); $field->save(); } // Fieldset page (requires PW v3.0.74 or later) if(!$fields->get("name=fspage_widget")) { $widget = new Field; $widget->type = $modules->get("FieldtypeFieldsetPage"); $widget->name = "fspage_widget"; $widget->label = $this->_('My Widget'); $widget->tags = "widget"; $fields->save($widget); } Problem arises when I try to add fields to the FieldsetPage. While the field is created, the template and field group are not. When I try to add via code, eg $widget = $fields->get("name=fspage_widget"); $templateName = FieldtypeRepeater::templateNamePrefix . $widget->name; // Correct name but no template yet assigned to FSPage field $template = $templates->get($templateName); // results in NULL $fg = $template->fieldgroup; // Ditto due to above $titleFld = $fields->get("name=widget_title"); $fg->add($titleFld); $fg->save(); // No fieldgroup so no save it falls over with NULL template and NULL fieldgroup. I can manually add fields to the FieldsetPage via the admin field edit screen, at which point the appropriate template & fieldgroup get generated. If I try to force the creation of the template in my code when I create the field, I end up with 2 templates - repeater_fspage_widget and repeater_fspage_widget1. That leads to all kinds of madness and no fields appear in the admin edit screen for 'fspage_widget' even though the field(s) I add show they're attached to a template. It's all clearly visible in the database. I've read everything I can find including the actual code and this forum article: In this scenario, the fieldsetPage fields with their templates & fieldgroups already exist and are being migrated. Even @ryan says a the end: So, question is, after adding a new FieldsetPage field via code, how do I programmatically add its template, fieldgroup & fields?
  2. Hi, is there a way to activate the option Input > Visibility > Presentation > "Open when populated + Closed when blank" for a Fieldset (Page) containing some fields like text or textarea? To me it is always open, even if all fields inside are empty. Thx, Matze
×
×
  • Create New...