- This topic has 18 replies, 3 voices, and was last updated 6 months, 1 week ago by
Fernando.
-
AuthorPosts
-
September 19, 2022 at 7:45 am #2347419
Gabriel
How can I inline dynamic data into a sentence in a query template for either an archive content layout or GB query loop? The Headline block will replace all content with dynamic data. The acf shortcode seems to only work for single posts, not in loops.
Example: When? [date] Where? [location]
September 19, 2022 at 11:21 am #2347754Ying
StaffCustomer SupportHi there,
GB headline block has this
inline width
option built in, can you give it a try?
https://docs.generateblocks.com/article/headline-overview/#spacingSeptember 20, 2022 at 12:23 am #2348145Gabriel
A step in the right direction but whitespace is added between the headline blocks on the same line. The whitespace is visible in the preview, not in the editor.
September 20, 2022 at 12:27 am #2348148Fernando Customer Support
Hi Gabriel,
Can you check if there’s a left or right margin/padding set for your Headline Blocks? If there is, try removing them.
September 20, 2022 at 12:32 am #2348152Gabriel
There’s no padding or margin. The inline width headlines get the style
display: inline-block;
. Since there’s whitespace between the divs in the HTML the whitespace being rendered is kind of expected.Added more details in private information.
September 20, 2022 at 12:36 am #2348158Fernando Customer Support
I see. How are you specifically getting the 60 min value?
September 20, 2022 at 2:48 am #2348237Gabriel
It is dynamic data from a custom field mapped to a headline block.
September 20, 2022 at 9:48 am #2348691Ying
StaffCustomer SupportIt is dynamic data from a custom field mapped to a headline block.
The dynamic feature just pulls the data from the custom field, can you make sure there’s no extra space in the custom filed’s value?
September 20, 2022 at 11:17 am #2348794Gabriel
There is no extra space in the custom field’s value. The extra space is only added in headline blocks. The acf shortcode adds no extra space, but sadly does not work in loops.
September 20, 2022 at 3:19 pm #2348947Ying
StaffCustomer SupportI inspected the HTML, there’s no space added:
https://www.screencast.com/t/M7MLcLEO0If you want the 3 headline blocks to be closer visually, add
-0.2em
margin left and margin right to the headline block which represent the60
.September 21, 2022 at 12:29 am #2349155Gabriel
Your screencast is the HTML formatted in a tree structure, white whitespace between tags removed. If you use “View page source” instead you can see that there is whitespace between the tags. Elements with
display: inline-block;
will have whitespace between tags rendered, same as withdisplay: inline;
.September 21, 2022 at 12:51 am #2349179Fernando Customer Support
Would adding a
add-parenthesis
to the class list of the Headline Blocks, and then adding this CSS work?:.add-parenthesis:before { content:"("; } .add-parenthesis:after { content:")"; }
September 21, 2022 at 1:07 am #2349198Gabriel
That could work but is a ugly workaround for this particular case only. If there is text on the same line it cannot be edited or translated by editors since it is hardcoded in the CSS.
Is the whitespace between tags when using inline width on headline blocks a bug or a feature?
September 21, 2022 at 1:23 am #2349212Fernando Customer Support
That’s the default behavior of inline-blocks in HTML. It’s not a bug in GP.
The other more common fix if you want inline-blocks to stick to one another is to set the font-size of the Container Block to 0. Then, set a font-size value to the Headline Blocks. This should work as well.
September 21, 2022 at 6:48 am #2349476Gabriel
That workaround allows for editing at least but I lose my default typography settings since I set font-size to 0 on the parent.
I understand there is not intuitive solution to inline dynamic data in the middle of a sentence at this time. Consider this a feature request.
-
AuthorPosts
- You must be logged in to reply to this topic.