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

Support controller src_type for head links #9588

Merged
merged 3 commits into from
Jul 6, 2017

Conversation

kassner
Copy link
Contributor

@kassner kassner commented May 10, 2017

\Magento\Framework\View\Page\Config\Generator\Head::SRC_TYPE_CONTROLLER was foreseen but never implemented. This small PR allows to define <link> tags with dynamic URLs linking back to the current store.

Example

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="customcss/render/css" src_type="controller" />
    </head>
</page>

This will render:

<link  rel="stylesheet" type="text/css"  media="all" href="http://magento.dev/customcss/render/" />

Given that http://magento.dev/ is the Base URL.

@ihor-sviziev
Copy link
Contributor

Why it's needed? Any custom css should be compiled during setup:static-content:deploy.

@kassner
Copy link
Contributor Author

kassner commented May 11, 2017 via email

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented May 11, 2017

In this case it's better to create some file(s) inside static directory with your code & give link to it.

@kassner
Copy link
Contributor Author

kassner commented May 11, 2017 via email

@okorshenko okorshenko self-assigned this Jun 30, 2017
@okorshenko okorshenko added this to the June 2017 milestone Jun 30, 2017
@okorshenko okorshenko modified the milestones: June 2017, July 2017 Jul 2, 2017
@magento-team magento-team merged commit 5e6afba into magento:develop Jul 6, 2017
magento-team pushed a commit that referenced this pull request Jul 6, 2017
 - fixed backward compatibility issues
magento-team pushed a commit that referenced this pull request Jul 6, 2017
@OZZlE
Copy link
Contributor

OZZlE commented Apr 3, 2018

which versions of magento was it merged to? Is it fixed in 2.1.x?

@ihor-sviziev
Copy link
Contributor

Hi @OZZlE,
This issue was fixed in 2.2.x branch, looks like it wasn't backported to 2.1-develop branch

@kassner kassner deleted the patch-4 branch June 1, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants