AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
9.0.4 edit page layout throws validator error when adding inline styles
Rank: Member
Groups: Developers, Registered, HelpDesk Joined: 11/7/2018(UTC) Posts: 23
Thanks: 5 times
|
The LayoutValidator[] throws an error if you add direct styles to div tags in the page layout. This prevents the admin user from saving the layout. for example, try adding this to a page layout via the edit-html icon: Code:
<div style="border:1px solid #ccc;" class="sidebar-sticky">
The problem is the ';'. The semicolon is required to specify multiple styles in a div tag, but the validator throws an error if a semicolon exists in the layout. |
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
A semicolon is not necessary here, you do not have multiple styles. You have one style with multiple options. You're also missing a closing tag. The purpose of the layout at this level is to create bootstrap containers within grids, I, personally, do not believe it's a good idea to apply visual attributes like a visual border at this level. But if you feel this is necessary, I would bypass any in-line elements and deal directly with multiple classes. Your choice, I hope this helps. -Ray Edited by user Saturday, April 9, 2022 3:22:19 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
UPDATE
I hope support response to this thread.
Using version 9.0.5, the system at this level will not let you have multiple styles in-line within a single DIV, but will let you have multiple styles, one each, across multiple DIVs.
I wonder if this is done intentionally to prevent this type of manipulation at this basic level of the system, or just a plain bug.
Again, I would never personally use the layout for any other purpose than just creating containers, but that's just me.
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
The layout files are created as .cshtml files and these razor files can execute c# code. So for security reasons, we are not allowing the following characters.
('@', '{', '}', ';')
Using CSS style classes instead of inline styling is recommended.
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
I figure it was by design, in-line styling can have devastating effects at this level. It might be a good idea on this page to post a disclaimer that says something like "In-line styling at this level is not recommended" or "Special characters are not allowed", just my two cents.
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
Thanks for the suggestion!
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
AbleCommerce 9 Bug Reports
»
9.0.4 edit page layout throws validator error when adding inline styles
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close