Skip to content

Add Header (h1 - h6) tags to layout xml htmlTags Allowed types #23742

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

Merged
merged 7 commits into from
Mar 12, 2020

Conversation

furan917
Copy link
Contributor

@furan917 furan917 commented Jul 17, 2019

Description (*)

The point of this PR is simply to allow H1 to H6 tags to be used in the layout XML as htmlTags so that users and theme creators can set titles with proper header tags using the XML. As an example a creator create a H2 container with a Magento\Framework\View\Element\Text block inside it to easily create titles where they need.

Manual testing scenarios (*)

1.add this block inside any referenceContainer you want

        <container name="some-title" htmlTag="h5" htmlClass="title">
            <block class="Magento\Framework\View\Element\Text" name="some.section.title">
                <arguments>
                    <argument name="text" xsi:type="string">Your title here</argument>
                </arguments>
            </block>
        </container>
  1. Clear Cache and Reload page and see that the Header tag is now working and does not throw a container type not allowed error

Questions or comments

I am not sure if there was a reason these weren't included so there may be something I am not thinking about but it seemed like it could be a helpful addition to devs and creators.
This is my first time contributing to M2 so please let me know if something can be done better or if I have missed anything.

There is a failure in the code sniffer for the Container.php I have changed but these failures, I think, are not introduced by me?

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jul 17, 2019

Hi @furan917. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@furan917
Copy link
Contributor Author

Static test build fails because the file does not match the set code standards before my editing it.
Good news as they are all fixable by automation. Or simple Doc updates so wont be a blocker.

@furan917
Copy link
Contributor Author

Hey @orlangur just looking to check if this is in review/needs further steps/further discussion or anything in case I can help with anything!

@orlangur
Copy link
Contributor

@magento run all tests

@sidolov sidolov changed the base branch from 2.3-develop to 2.4-develop December 5, 2019 17:20
@ihor-sviziev
Copy link
Contributor

@orlangur could you explain why this PR was moved to On hold and what is the current status?

@ihor-sviziev ihor-sviziev self-assigned this Mar 4, 2020
…d types

Update integration test to check all types of containers
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-7038 has been created to process this Pull Request
✳️ @ihor-sviziev, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@magento-engcom-team
Copy link
Contributor

@furan917 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@ihor-sviziev ihor-sviziev added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Mar 4, 2020
@engcom-Alfa engcom-Alfa self-assigned this Mar 5, 2020
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Before:
before

After:
after

@m2-assistant
Copy link

m2-assistant bot commented Mar 12, 2020

Hi @furan917, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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.

7 participants