Shortcodes - integration with Gutenberg, and how to use them inside a link
Support › General › Shortcodes - integration with Gutenberg, and how to use them inside a linkResolved
- This topic has 6 replies, 3 voices, and was last updated 3 years, 11 months ago by
Long Nguyen.
-
AuthorPosts
-
April 22, 2021 at 11:07 PM #27529
OldGreg
ParticipantHello,
A couple of questions regarding dynamic data usage from custom fields.
1) I see you support page builders like Elementor and Beaver, but I don't see an easy way to search for fields and insert them using Gutenberg. Gutenberg is the future - please let me know how we can add support for searching field meta ids inside Gutenberg and add them into our content easily.
2) I would like to use the custom field value inside a link. When using a standard "link" in Gutenberg builder, I am unable to use the shortcode directly. How can we get the value of a field for the post being edited to include it in a tel: link (the field is a phone number).
Thank you for such a great plugin!
April 23, 2021 at 10:36 AM #27554Long Nguyen
ModeratorHi OldGreg,
Thank you for reaching out.
-
Can you please clarify the question? Do you mean to search posts by field value?
-
There is an extension MB Blocks that helps you to create a custom block to use on the Gutenberg editor. You can create your own block and show the custom field value, follow this documentation https://docs.metabox.io/extensions/mb-blocks/
April 24, 2021 at 9:34 AM #27585[email protected]
ParticipantI also do feel very lost, don't understand how to display custom fields of a post inside the post using shortcodes.
Your forum is too crowded for finding relevant info, your documentation lacks real-life examples.I have created 2 custom fields "author" and "year".
I have created a now post and entered "peter" and "2004" into those fields.
I have inserted a shortcode inside the post: [rwmb_meta id="field_id"] as explained in your docs on https://docs.metabox.io/displaying-fields/, but none of the fields are being displayed 🙁Why you make it sooo complicated? Please help better to display fields via gutenberg via shortcodes, thanks.
Sascha
April 24, 2021 at 6:29 PM #27604Long Nguyen
Moderator@Sascha,
Did you replace the
field_id
with your real field ID? The field value will show on the frontend after saving the post. See more on my screen record https://share.getcloudapp.com/d5u1OkNNMay 2, 2021 at 6:25 PM #27828[email protected]
ParticipantThanks, now I have understood.
I would recommend adding a sample use-case to each of your documentation for all those none coders among your clients 😉May 2, 2021 at 9:55 PM #27829[email protected]
ParticipantOne more thing: I have created CF and now I'm able to display them on a post.
I have now realised, when placing the shortcude inside a group, the CF will be displayed within the templates layout. but as soon as I place the shortcode between 2 default paragraph blocks, the CF will be displayed at the very left border of the page, not within the content section of the page-template:
https://adhesiveknife.tastewp.com/2021/04/19/officia-expedita-et-ipsa-eaque/
CFs are:
author = "Peter Lustig"
year = "1999"Here a screenshot from the editor:
http://media.macbay.de/_support/asdiuvsdgf_263EF49F.pngAny chance to help me further with this?
Thanks in advance and have a lovely day 🙂
Sascha
May 3, 2021 at 10:13 PM #27847Long Nguyen
ModeratorHi Sascha,
The layout is controlled by the theme. You can wrap the first shortcode in a group with one column or contact the theme support to ask for help in this case.
-
-
AuthorPosts
- You must be logged in to reply to this topic.