addHeaderItem() seems to render twice when called by on_page_view()
Permalink
Hi all
I have a custom block which uses addHeaderItem() in on_page_view(), but it seems to be called twice.
Gives this:
(obviously 'actual data' is full of the correct stuff, in reality.
I can't see where I'm going wrong. I've tried passing VIEW and CONTROLLER as second arguments to on_page_view(), but no luck.
If I replace the call with a simple string:
it works fine and gives no error.
Can anyone see where I'm going wrong? HTML helper?!
I have a custom block which uses addHeaderItem() in on_page_view(), but it seems to be called twice.
$scripts = '<script type="text/javascript"> var simple_markers_addresses = [' . $addressesString . ']; var simple_markers_descriptions = [' . $descriptionsString . '] </script>'; $this->addHeaderItem($scripts);
Gives this:
<script type="text/javascript"> var simple_markers_addresses = []; var simple_markers_descriptions = ["<div><span></span><p><strong><a href='http://'>Website ></a></strong></p></div>"] </script> <script type="text/javascript"> var simple_markers_addresses = ["actual data"]; var simple_markers_descriptions = ["actual data"] </script>
(obviously 'actual data' is full of the correct stuff, in reality.
I can't see where I'm going wrong. I've tried passing VIEW and CONTROLLER as second arguments to on_page_view(), but no luck.
If I replace the call with a simple string:
$this->addHeaderItem('hello');
it works fine and gives no error.
Can anyone see where I'm going wrong? HTML helper?!