Skip Navigation

[Resolved] Question about inline dynamic fields and excerpts in a paragraph

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Shane 3 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#2139591

Hello,
I just read about the new feature that allows displaying dynamic sources inside text blocks. Very cool!

I would like to use the Inline Fields option to insert the post's excerpt inside a paragraph since adding the excerpt via the Single Field block does not wrap the excerpt in a <p> tag.

I assumed it is possible to add an excerpt Inline to the Toolset Heading/paragraph block because the following Toolset documentation (https://toolset.com/course-lesson/display-dynamic-sources-inside-all-text-blocks/)
say this: You can change the format of certain types of custom fields (dates, taxonomies and excerpts), by clicking on them.

However, the dropdown menu for Source does not contain the post excerpt as an option.

So my questions:
1. Is excerpt supposed to be an inline option?
And if not...
2. How can I wrap the excerpt Single Field in a <p> in the front end?

Thanks!
Sarah

#2139681

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sarah,

Thank you for getting in touch.

You are correct that the post excerpt doesnt show up.

However you can wrap it in a p tag by doing this.

<p>[wpv-post-excerpt]</p>

Using the post excerpt shortcode should help in this scenario.

Thanks,
Shane

#2142339

Hi, thanks, Shane. I did a bit more testing and have updated my question!

I found that I can insert the excerpt via the following two blocks, and both automatically wrap the excerpt in paragraph tags in the front end:
1. The Toolset "Heading" block, set to Paragraph and using "Dynamic Heading Text"
2. The "Fields and Text" block and insert the Post excerpt shortcode.

What block are you suggesting I use where I can wrap [wpv-post-excerpt] with <p>?

When I add post excerpt to the <stong>"Single Field" block, I am unable to add <p> tags.
In the Visual view of the block, I see the dynamically inserted excerpt. In the Html view of the block, I see:

<div class="tb-field" data-toolset-blocks-field="1" data-last-update="1.4">[tb-dynamic provider="__current_post" post="current" source="post-excerpt" force-string='first' length="30" countBy="word" renderEllipsis="true" ellipsisText="..." originalContent=""]</div>

If I attempt to edit this code to add any custom html, I get an error: "This block contain unexpected or invalid content."

I can use either of the two block options above to automatically get my excerpt in a paragraph, but, ideally, I would like to use the "Single Field" block to dynamically insert excerpts since it has the easy-to-use "Field Options" in the Block settings to adjust excerpt options.

So, my revised question is:
How can I force excerpts added via the "Single Field" block to be wrapped in <p> tags?
Why do the "Heading" and "Fields and Text" blocks auto-add the <p> tags, but the "Single Field" block does not?

Thank you,
Sarah

#2144055

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sarah,

The <p>[wpv-post-excerpt]</p> shortcode with the p tag can be added to any block that processes shortcodes such as the Classic block and the Fields and Texts block.

Why do the "Heading" and "Fields and Text" blocks auto-add the <p> tags, but the "Single Field" block does not?

The single field block in the case of the excerpt will display the raw value from the database since the Single Field block will only have special formatting with our Toolset custom fields.

None Toolset fields will display with their raw values.

The Headings and Fields and Texts blocks are general purpose blocks so they will display with predefined tags. I know for the headings block it will display the header tags.

The Fields and Texts block is essentially a WYSIWYG editor so it will auto add the paragraph tags.

Please let me know if this provides some clarity for you.
Thanks,
Shane