logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne @ Solunar  
#1 Posted : Friday, April 8, 2022 8:57:01 AM(UTC)
Joe Payne @ Solunar

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.
Joe Payne, AbleMods Hosting LLC
https://www.ablemodshosting.com

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

ray22901031  
#2 Posted : Saturday, April 9, 2022 3:21:31 AM(UTC)
ray22901031

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

ray22901031  
#3 Posted : Saturday, April 9, 2022 9:38:29 AM(UTC)
ray22901031

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.
shaharyar  
#4 Posted : Monday, April 11, 2022 12:55:03 AM(UTC)
shaharyar

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
ray22901031  
#5 Posted : Monday, April 11, 2022 1:06:00 AM(UTC)
ray22901031

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.
shaharyar  
#6 Posted : Monday, April 11, 2022 1:11:18 AM(UTC)
shaharyar

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!
Users browsing this topic
Guest (3)
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.