
-
AuthorPosts
-
April 5, 2022 at 12:46 pm #1347269
Dear support
we noticed a issue regarding the shop-manager user role. we included in our pages enfold code blocks with schema markups for youtube videos. the code within the element starts with
<script type="application/ld+json">
– if a admin or author user edits the page everything is saved as expected. because of user right restriction we are using for some editors now the shop manager user role, but – if someone with this user role is editing a page the<script type="application/ld+json">
part at front and the end of the code is deleted and the code shows up in the front end.How can we fix this behaviour of shop manager user role?
Thanks in advance Marc
April 6, 2022 at 8:12 am #1347352Hey L-mobileGroup2022,
Thank you for the inquiry.
We do not recommend embedding script or input tags directly in the builder or any of its element because these tags could break the layout of the builder. What you can do instead is to add the JSON LD schema using hooks such as wp_footer or wp_head.
Example:
add_action("wp_footer", function() { if( is_page(13) ) { // json ld here } }, 10);
Or use a plugin such as the following.
// https://wordpress.org/plugins/schema/
// https://wordpress.org/plugins/wp-structuring-markup/Best regards,
IsmaelApril 6, 2022 at 8:54 am #1347370Dear Ismael
thanks for the code snippet. We do not want to use a plugin because we only put the json for embedded videos on the pages for google use. If we follow your advice where to put the code? Otherwise we already using the plugin header & footer code and could be placed there.
Problem is that we want to have the markup nearby the embed video and we have to work over a lot of pages to change that. What is the problem that this behaviour only appear on the shop manager role while working with other roles everything went fine?
Best Regards Marc
-
This reply was modified 3 years, 3 months ago by
L-mobileGroup2022.
April 8, 2022 at 11:37 am #1347692Hi,
Thank you for the update.
The schema markup doesn’t have to be nearby the embed video, it just have to exist in the same page. You can use a plugin to add the snippet above or just add it manually in the functions.php file. Unfortunately, we are not sure why it is not working with a specific user role, all roles that can edit a page should be able to properly edit the elements in the Advance Layout Builder (ALB). But again, we do not recommend adding script or form tags directly in the builder because they could break existing layouts.
Best regards,
Ismael -
This reply was modified 3 years, 3 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.