Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Add html example for adding a new class to the <body> tag #6989

Merged
merged 6 commits into from
Apr 6, 2020

Conversation

abrarpathan19
Copy link
Contributor

@abrarpathan19 abrarpathan19 commented Apr 5, 2020

Purpose of this pull request

Added an html example for adding a new class to the tag.

Affected DevDocs pages

whatsnew
Added HTML example in the Common layout customization tasks topic.

@devops-devdocs
Copy link
Collaborator

An admin must run tests on this PR before it can be merged.

<attribute name="class" value="my-new-body-class"/>
</body>
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is already provided on lines 229-237.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this example. It duplicates the example that appears on 229-237:

Example: Add a new class to the body tag.

<page>
    <body>
        <attribute name="class" value="my-new-body-class"/>
    </body>
</page>

Copy link
Contributor

@meker12 meker12 Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to delete this example -- Make sure you check for linting errors -- no trailing spaces or extra blank lines after deleting.

If you check the test results at the bottom of the PR, you'll see that this PR is failing.

image

@@ -246,6 +246,16 @@ To set attributes for the HTML `body` tag use the `<attribute>` instruction.
</page>
```

Also from admin site __Layout Update XML__ field of __Design__ section on _Content Edit_ page set attributes for the HTML `body` tag use the `<attribute>` instruction.
Copy link
Contributor

@meker12 meker12 Apr 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you are trying to do by adding this information here. Can you provide more information about the reason you want to include this update here?

We do have Merchant documentation that explains how to do this from the Admin: https://docs.magento.com/m2/ee/user_guide/design/layout-update-place-block.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @meker12,
This information is for adding custom class in <body> from admin, No need to add code in XML or PHTML

@meker12 meker12 changed the title Add a new class to the <body> tag from admin Add example for adding a custom class customizing specific layouts from the Magento Admin Apr 5, 2020
@meker12 meker12 changed the title Add example for adding a custom class customizing specific layouts from the Magento Admin Add example for adding a custom class from the Magento Admin Apr 5, 2020
@abrarpathan19
Copy link
Contributor Author

Hello @meker12, I have updated PR as per requested.

<attribute name="class" value="my-new-body-class"/>
</body>
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this example. It duplicates the example that appears on 229-237:

Example: Add a new class to the body tag.

<page>
    <body>
        <attribute name="class" value="my-new-body-class"/>
    </body>
</page>

</body>
```

![Block Class]({{ site.baseurl }}/common/images/body-class-result.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the image after the original example for adding a new class to the body tag-- after line 237.

@meker12 meker12 changed the title Add example for adding a custom class from the Magento Admin Add html example for adding a new class to the <body> tag Apr 6, 2020
@meker12 meker12 added the Technical Updates to the code or processes that alter the technical content of the doc label Apr 6, 2020
Copy link
Contributor

@meker12 meker12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to delete the duplicate example and fix linting error.

@abrarpathan19
Copy link
Contributor Author

Still need to delete the duplicate example and fix linting error.

@meker12 I have updated file, please review again.

Thanks

@meker12
Copy link
Contributor

meker12 commented Apr 6, 2020

running tests

@meker12 meker12 merged commit 35f7a0f into magento:master Apr 6, 2020
@ghost
Copy link

ghost commented Apr 6, 2020

Hi @abrarpathan19, 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.

@hguthrie hguthrie added the 2.3.x Magento 2.3 related changes label Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2.3.x Magento 2.3 related changes Event: Global-Contribution-Day Partner: Krish TechnoLabs partners-contribution PR created by Magento partner Technical Updates to the code or processes that alter the technical content of the doc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants