Skip to content

Add extra configurations to Semantic Breadcrumbs #314

@DiegoPino

Description

@DiegoPino

What?

Right now our ADO breadcrumbs are very flexible but sometimes when you have multiple levels of relationship between children and parent you might want to be able to choose to e.g exclude from breadcrumb a few predicates or the opposite, force breadcrumb to only work on a few.

Because breadcrumbs use one of our computed field here

$fields['field_sbf_nodetonode'] = BaseFieldDefinition::create('entity_reference')
->setName('field_sbf_nodetonode')
->setLabel('Related ADOs')
->setSetting('target_type', 'node')
->setTargetEntityTypeId('node')
->setDescription(t('Computed Node to Node relationships'))
->setComputed(TRUE)
->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
->setRevisionable(FALSE)
->setReadOnly(TRUE)
->setTranslatable(FALSE)
->setClass(StrawberryFieldEntityComputedItemList::class);
return $fields;

that fetches any ADO to ADO relationship, one option would be to allow computed level sub properties
So a getValue() directly on the field will get me all, but another accessor with arguments would allow me to filter out
Another option is to have a second computed one. We could of course simply use this via normal field/data logic (kinda bring out of the class the code and query the JSON directly) but i like computed fields because they abstract and hide complexities and allow us in the future to improve the logic without changing the calling code.

Anyway. This is needed for 1.4.0 before the release

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions