I am using the leaflet module and have a view that displays a block with the map that works. This block can be displayed on the same page layout as the node but appears below comments for the node. I would like the map block to appear above the comments immediately following the node.
The https://github.com/backdrop-contrib/eva module looked like a good option although I don't have experience with it. After installing the eva
module and clearing caches, in the view the block display was cloned as an eva field. In the Entity content settings
the entity type was identified as Node
, the bundle for the content type was selected, Show on
was to display, and Arguments
set to id
. The eva field shows on the content type as a display field.
However, when viewing the node there is an error:
Notice: Array to string conversion in include() (line 56 of \eva\templates\eva-display-entity-view.tpl.php).
and the leaflet map is not visible, only the views header is visible followed by the word Array
.
Following up on a suggestion in office hours line 56 of the tpl.php
file was changed <?php print $rows; ?>
to dpm($rows)
and the results do include the leaflet map ID.
I would appreciate any suggestions on how to get the leaflet map to display as an eva field.
Comments
Do you have a contextual filter? You might need that if you're setting an argument to be passed in.
Though does sound like there needs to be a check in the preprocess to prevent the array to string warning.
@Herb thank you for your comment.
Yes, there is a Contextual filter (Content: Nid) in the view that is required by the block display for it to work and the Block settings, contextual filter input url position is 2. On the EVA field display the same Contextual filter is still there. However, the Entity content settings does not include a Contextual filter input, instead it has Arguments that is set to id.
Does a check in the preprocess require a PR to the EVA module or can it be done in a template file?