Make a View Available Anywhere in Your Templates

The registerView() method allows you to register a view to a component, making the view available anywhere that component is available. This functionality makes it easier to use simple views in any template in your theme. You should not use the registerView() method for every view, but instead use it: For views that are self contained and do not… Continue reading Make a View Available Anywhere in Your Templates

addToViewContextDefinition

addToViewContextDefinition( view_id, property_name, type, callback ) Adds a property to the context data of a view. The property can then be referenced in templates. If the property already exists in the context data of the view, it is updated. For example, if a view has a property called ‘thumbnail’ and you pass ‘thumbnail’ in the property_name argument, then the return… Continue reading addToViewContextDefinition