I'm using Glass.Mapper for an actual project and need to implement value inheritance.
I have for example meta keywords, which i want to map into a Glass.Mapper model. If the field is empty, i want to find the nearest parent item which has a value in that field and use that value in my current model.
The field is a Single-Line Text
named Meta Keywords
.
Home Item -> "Keyword1, Keyword2"
First Child -> Empty
Current Item -> Empty
Because the current item has no field value, i want to do a recursive check and get the value Keyword1, Keyword2
from the Home Item
within my current Glass.Mapper model.
What would be the best approach to do that? I know there is a Field Fallback module out there, which does that type of things and sets the value as the Standard Value of the current item dynamically. Does Glass.Mapper provides some functionality to do this in a simpler way?