-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add html example for adding a new class to the <body> tag #6989
Conversation
An admin must run tests on this PR before it can be merged. |
<attribute name="class" value="my-new-body-class"/> | ||
</body> | ||
``` | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Hello @meker12, I have updated PR as per requested. |
<attribute name="class" value="my-new-body-class"/> | ||
</body> | ||
``` | ||
|
There was a problem hiding this comment.
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> | ||
``` | ||
|
||
 |
There was a problem hiding this comment.
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.
Co-Authored-By: Margaret Eker <meker@adobe.com>
There was a problem hiding this 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.
@meker12 I have updated file, please review again. Thanks |
running tests |
Hi @abrarpathan19, thank you for your contribution! |
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.