Skip Navigation

[Resolved] Formatting of shortcodes in Fields and Text block

This support ticket is created 3 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 7 replies, has 2 voices.

Last updated by goranO-2 3 years, 3 months ago.

Assisted by: Jamal.

Author
Posts
#2142903
Toolset_ Kadence Element.jpg

Tell us what you are trying to do? - Trying to format the output from shortcodes in the Fields and Text block. 4 issues. See comments in the screenshot. (also, if you can advise how to format the Read More as a button it would be great!)

Is there any documentation that you are following? - just the instructions for this block

Is there a similar example that we can see? - hidden link

What is the link to your site? - hidden link

#2143023

Hello and thank you for contacting Toolset support.

The blocks styles are not really expected to apply for shortcodes generated content. Especially, because the blocks' styles are scoped using data attributes IDs, such as data-toolset-blocks-fields-and-text="144e4766c7a0f5876e1b93f933dae8bf". Check this screenshot hidden link

However some styles should still apply, or you can pass your own CSS code to the content template.

This being said, I'd like to check each of the issues that you have shown in the screenshot.

Regarding the title, I wonder where did you add the styling to make it capitalized? Can you share a screenshot?
You are currently using the Fields&Text block for it. What if you use the Single Field block or the Toolset Heading block?

Regarding the excerpt, it was generated outside of the left aligned <p> tag. Check this screenshot hidden link
What if you used a "Single Field" block or a Paragraph block with inline sources?

Regarding the gravatar image before the author's link, it is caused by a global style of the Kadence theme that makes images to appear in their own block(vs inline images). Check this screenshot hidden link
This will probably need a custom CSS code to be fixed.

The "Read more" button is somehow similar to the title, I don't see where the styles were assigned for the block. Can you share a screenshot?

Would it be possible to let me log into your website and check this from the backend? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2143157

Thank you for the credentials. I logged In and I can see the issue better now. It is a Kadence element that you configured to appear after the header on the front page, right! hidden link

Both websites use different themes. So the styling won't be the same. In addition, the hidden link website relies on theme styles for the hero section. Using CSS classes in the markup. For example "op-homepage-hero" and "op-homepage-hero-featured-post".

This being said, I would not recommend using a Fields&Text block for each part of the hero section. Because each block will be wrapped in its own div tag. And that may be problematic if you will be using custom CSS like the hidden link theme
Check this screenshot hidden link

I think that building this hero section inside a Kadence Element will be difficult because the Toolset dynamic sources will not let you get the information that is related to a post(vs a Kadence Element), such as the category, excerpt, author, date, and read more button.

Instead, I suggest that you build the design inside a content template, then insert the content template inside of the Kadence Element. Because, inside a content template, you can choose what post to preview with, and this will help Toolset offer the post-related data in the dynamic sources. The shortcodes will also pull the data from the preview post. Check this screenshot hidden link

This will let you use Single Field blocks and define the dynamic source(for the title it is the categories taxonomy) check this screenshot hidden link

You can do the same for the excerpt and the "Read-More" button.

However, for the gravatar image, you will need a custom CSS code. I'll suggest adding a class to the a "Fields&Text" block, and using it in custom CSS code to make the image display inline:

.my-class img {
  display; inline;
}

We can work on this later. But, first, I want to make sure that you understand my suggestion( using a content template inside a kadence element). Does it make sense?

I already created a content template and added a title to it. I'll let you work on it to add the excerpt and the "Read Mode" button. Then, use it inside the Kadence element and check if it gives the expected results. At that point, I'll help you with the custom CSS for the gravatar image if still needed.

#2143205

Thank you, Jamal, I gave it a try and it seems as I've got all the dynamic info there but not the formatting.
I've inserted a 2-column grid for the READ MORE button and for the meta data.
Don't know how to create and add the class for the author image (will look it up, but it has to be later).
Can't figure out why everything becomes centered when added to the container in the Kadence Element.

#2143259

I figured out the align: left in the container settings inside the Kadence Element

#2143271

And .... I fixed the author image inline (there was a ; instead of a : in your code ;-))
Now I just need to write a new post and see if it works and also to figure out how to offset the blog list below not to show the latest post. Maybe you have a quick solution for that?

#2143675

Awesome, I am glad I could help. Let me know what you will get with a new post. Let me know what you will get.

However, for support rules, we are able to handle only one issue at a time. This helps us to bring you a better service and also helps other users to find all the information here exposed. For that reason, I have to kindly ask you to open a new thread about your last question and we'll do our best to help. You can ask to assign it directly to me, so we can continue together.

#2149307

My issue is resolved now. Thank you!