Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/15/2012 in all areas

  1. Cool! I think you only need this line: $field->derefAsPage = FieldtypePage::derefAsPageOrFalse; Edit: just reading again... you want to select fields not pages? Why not just use a simple select? I think ASM select and the others depend on the fieldtype page, which hold the setting to select multiple or only one. Not sure if there's a way to use ASM select for this, as it's always possible to select multiple.. just 1 will be saved. I need to think again what you're really trying Edit: oh and in modules you can always just use. $this->modules->get("nameofmodule"). Edit: I recently used something like this in my DataTable module, maybe this is of help too. $field = $this->modules->get("InputfieldSelect"); $field->attr('id+name', 'filter_template'); $field->label = "Filter by Template"; $field->description = "...."; $field->addOption('', 'Show All'); foreach($this->templates as $t) { $name = $t->name; if(($t->flags & Template::flagSystem)) $name .= "*"; if($this->optionTemplate == $t->name) { // optionTemplate is just example, depending on how you save the settings in your case $field->addOption($t->name, $name, array("selected"=>"selected")); } else { $field->addOption($t->name, $name); } } }
    1 point
×
×
  • Create New...