Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets using TypoScript unable to force placement in header instead of footer #1658

Open
typoworx-de opened this issue Jun 4, 2020 · 1 comment

Comments

@typoworx-de
Copy link

I noticed VHS asset-management seems to stuck enforcing JS to be placed into HTML Head instead of Footer while using vhs-asset using TypoScript.

This is an example running using VHS 6.0.0

plugin.tx_vhs {
    assets {
        tagsAddSubresourceIntegrity = 0
        mergedAssetsUseHashedFilename = 1
    }

    settings {
        asset.debug = 0

        assetGroup {
            core {
                name = core
                standalone = 1
              	relocateToFooter = 0
              	enableFooterRelocation = 0
            }
        }
    }
}

plugin.tx_vhs.settings.asset >
plugin.tx_vhs.settings.asset {
    jQueryJS {
        name = jQueryJS
        path = EXT:my-sitepackage/Resources/Public/Javascript/jquery-1.12.0.min.js
        # also tried with:
        # group = core
        standalone = 1
      	movable = 0
        relocateToFooter = 0
        enableFooterRelocation = 0
    }
}

jQuery is still placed into Footer!!! I also did some code-research into VHS and found settings which where unknown to me yet:

relocateToFooter = 0/1
enableFooterRelocation = 0/1

this is very confusing. What is the purpose of these compared to the already existing 'movable' setting and are all of these settings valid for typoscript asset-includes and fluid-based v:asset.script includes as well?!

In fact I was not able to enforce jQuery to be placed into Head in any combination/way. I have an site-setup which requires jQuery to be present in Head already, so footer-placement or refactoring the whole site is not an option in my case.

As there are already a bunch (?!) of settings which aim to give control over this, I don't understand this feature doesn't seem to work properly at all.

Is there anything wrong with my code above?!

@typoworx-de
Copy link
Author

I should mention I'm also have optional asset loading in fluid template using v:asset.script which should be loaded "independent" from those assets like jQuery required anyway. Those are rendered as separate script-tag to the one in the footer containing only jQuery (from example code above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant