Replies: 2 comments 9 replies
-
Other plugins don't use ids to generate styles, Kadence uses unique classes like I also think we need to make the |
Beta Was this translation helpful? Give feedback.
-
Isn't this problem was solved by adding to block from for example FSE head template part |
Beta Was this translation helpful? Give feedback.
-
Linked to #4967
Ok, so we decided to go away from our way to generate styles, fonts and meta per page, because it makes archive pages, custom taxonomies, loops, reusable blocks, FSE, etc. broken.
So we now generate everything per a block, and add styles, fonts, etc. to new DB tables that are working per a block. Then we check all blocks on frontend and load the styles / etc. we need. We also add a php style processor and generator to run without the Gutenberg editor.
PROBLEM
Now, we have a problem with our uniqueID attribute, that is also the
id
attribute on frontend, because it's not really unique on the site, it's unique per a page. And all our styles, scripts, meta, fonts, everything work by that id.I've fixed the styles by adding a really unique attribute
styleID
fordata-maxi-style-id
on frontend:So I've changed something like
body.maxi-blocks--active #number-counter-maxi-1
to
body.maxi-blocks--active #number-counter-maxi-1[data-maxi-style-id=maxi-1689071551556-pgtx66x]
and it works great for styles generation, but we still have
number-counter-maxi-1
as the id.And if we open a category page with several posts that have NCs, we have several NCs with
#number-counter-maxi-1
(same for the containers and everything else). Now, styles are not broken because of the[data-maxi-style-id=maxi-REALLY_LONG_SHIT]
, but the html is still invalid, because we have duplicated ids. Same problem for any loop or blog with posts that have Maxi blocks. Doubled ids everywhere.SOLUTION
One idea that I have to resolve it is to merge uniqueID and styleID into one really unique thing, and use it as the id in html. Migrations are going to be a nightmare, but we still need to migrate all the existing blocks to 'per block' DBs anyway, so... it's already a nightmare.
I welcome any other ideas or possible solutions, because we can't really generate any invalid html.
Beta Was this translation helpful? Give feedback.
All reactions