Skip to content

Extensibility of adding vars #10

@jissereitsma

Description

@jissereitsma

In the footer template (

["addVar", "p_type", "{$block->escapeJs($pageType)}"],
) the variables p_type and p_gen are added. Is it possible to add custom variables here as well?

If so, it would be nice to add a custom logic here for developers to insert more data. For instance, the lines could be replaced with something like the following:

<?php foreach ($block->getPageVariables() as $variableName => $variableValue): ?>
    w.BOOMR_mq.push(["addVar", "<?= $variableName ?>", "<?= $variableValue ?>"]);
<?php endforeach; ?>

And ideally the $block is actually not used for this, but a ViewModel instead (see PR #8 ).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions