Views Inject View Results
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Component created
Component changed
Component body
What is Views Inject View Results module?
Views Inject View Results module allows to inject results into view from other view.
The results are injected at position set as per 'position' field which should be in filtered content type - for the view that is to be injected.
The injected results will remain in fixed position (value of the 'position' field) while the primary view results will 'roll' around.
Use-case
The news timeline with injected adds, where the adds are in fixed position and news are sorted by publish date and rolling around the adds.
By having adds in fixed position it is possible to:
- Run marketing campaigns right in the timeline.
- Sell the add spots/location(s) which potentially could pay at least site maintenance costs.
Placing the adds in the timeline has use especially on the mobile platform, where the user sees usually single column.
Supported features
- The Views Inject View Results module supports views pager and it's variations such as Views Infinite Scroll.
 The view may be loaded in smaller chunks (pages) and the injected results (adds) will stay in the fixed position.
- The injected rows are rendered as per 'view to inject' display. 
There is no need to insert the fields from 'view to inject' into the 'main' view and definitely the content type selected in 'Filter criteria' should not be in 'main' view.
- The custom template 
(.tpl)
 files can be used but you should pay attention to use expanded template name where the view and display machine name is used: views-view-field--[view_machine_name]--[display_machine_name]--[field_machine_name].tpl.php
How does it work
The results (rows) from 'view to inject' are injected to 'main view' results at the position as per 'order field', which has to be the 'integer' type.
Injected rows have added 'view inject settings'.
When 'main view' is rendered the style plugin will output the rows which have 'view inject settings' using the 'view to inject' display.
In other words the style plugin will switch the style from 'main view' default to 'view to inject' should the row have 'view inject settings'.
While the rows are injected, the sort criteria for the 'view to inject' display are ignored.
This allows the 'view to inject' to be used for other purpose and have its own sort criteria.
While style plugin can switch the style on per row bases, the rows and the fields are rendered as per view display they are pulled from.
This allows to use (.tpl) template files for each view separately.
Above allows to inject results from one view into another and have full flexibility on per view bases.
What it does not do
The module does not:
- Help to manage the 'injected' content. Meaning it will not check if the 'order' field has unique value.
- Identify the 'order' field. The administrator is responsible for selecting correctly the 'order' field, when configuring the 'main view'.
- Insert into the content or helps to set/configure 'order' field.
- Check if the 'main view' and 'view to inject' return unique content. Administrator has to configure 'filter criteria' for both views in the way the do not return overlapping results - unless this is an intention.
