Skip to content

filterstring / not an issue #10

@seppzzz

Description

@seppzzz

Not an issue but an idea:

 foreach ($linkables as $class) {
            $identifier = str_replace('\\', '-', strtolower($class));
            $options[$identifier] = $class::LinkLabel();
            $linkTipe->setSource($options);
			
$linkableFilterString =  method_exists($class, 'linkableFilterString')? $class::linkableFilterString() : '';

            $dropdown = new DropdownField($identifier, _t('HtmlEditorField.NEWS', $class::LinkLabel()), $class::get()->where($linkableFilterString)->map('ID', 'Title'));
            $dropdown->addExtraClass('linkable');

            $compositeField->insertBefore($dropdown, 'Description');
        }

public static function linkableFilterString(){
		return "StartDate >= CURDATE()";
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions