Skip Navigation

[Gelöst] Custom Shortcodes within fields

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

In order to get the look we need, we use WPBakery shortcode template for our posts.

Is there a way to get the shortcode (visible or invisbile) inside the Toolset Forms WYSIWIG field to get the same functionality on the frontend?

Solution:

But you can input the WPBakery shortcodes into wysiwyg field, and the wysiwyg field of Toolset form won't be able to display the WPBakery shortcode as HTML codes, it will display the WPBakery shortcodes directly

Relevant Documentation:

This support ticket is created vor 6 Jahren. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 11 Antworten, hat 3 Stimmen.

Zuletzt aktualisiert von michaelM-30 vor 6 Jahren.

Assistiert von: Luo Yang.

Author
Artikel
#1139763

Tell us what you are trying to do?
In order to get the look we need, we use a shortcode template for our posts.
Is there a way to get the shortcode (visible or invisbile) inside the CRED Forms to get the same functionality on the frontend?
It should be inside the WYSIWIG form field.

If I try to input the shortcode into the form it is displayed on the input (formI page. But I need this on the finished frontend page.

What is the link to your site?
our site is not visible to the open.

#1140278

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I do not understand yet what exactly you are looking for. Do you mean that you want to add shortcode to form field? I need more information to understand your issue. Few screenshots will be helpful to understand your issue.

I have set the next reply to private which means only you and I have access to it.

#1140298

The image Front-End.jpg shows the output you get when using our normal approach.
It is NOT the output we get when using CRED - as the part of shortcodes in the WYSIWYG entry is missing in the form.

#1141242

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Well - as I can see the WYSIWIG form field does not looks like that it's a field created using Types or normal post field. Using which plugin that field is created?

If its third party plugin field - could you please check following Doc:
=> https://toolset.com/documentation/user-guides/letting-cred-edit-custom-fields-created-by-other-plugins/

#1141453

Sorry, I dont't understand it.
We are using WPBakery for creating the code - which I thought is working with Toolset.

In your documentation page it says
For a post type to be selectable here, it needs to be configured as public, publicly queryable and visible in the GUI.

I do not know how to generate the post type with my custom html code.
Where do I do that?

Besides - isn't it possible to integrate custom html code or shortcodes for this matter in CRED? Or is the only way to do that as you described?

Thanks

#1141995

Hi,

Minesh isn't available, I will take care of this thread.

I assume we are talking about this case:
1) You are going to input shortcodes (for example [vc_row] ... [/vc_row]) from WPBakery plugin into a custom WYSIWYG field of Toolset form.
2) Display the WYSIWYG field value in front-end, and resolve WPBakery shortcodes into HTML codes.

If it is, I just tested it in my localhost with plugin WPBakery version The7 WPBakery Page Builder version 5.5.2.1, it works fine, you just need to output the field value with Types shortcode, for example:

[types field="my-wysiwyg"][/types]

In your case don't use attribute output="raw", this will output the [vc_row] shortcode directly.

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#wysiwyg

#1141999

Hi, sorry to bother you again.

Sorry If I don't understand you right - I am not a programmer.

Yes you are right - If I paste my code ( [vc_row] ... [/vc_row]) into the wysiwyg field on the form - everything outputs fine on the front end.
But what I am trying to achieve is that the code is in the form (maybe not visible to the users) but still outputtet on the front end.

So in my backend form I am trying to incorporate the code [vc_row] ... [/vc_row] into this directly - without the user copy/pasting my [vc_row] ... [/vc_row] code.

<div class="form-group">
<label>Wysiwyg - af831d55</label>
[cred_field field="wysiwyg-af831d55" force_type="field" class="form-control" output="bootstrap"]
</div>

#1142015

I assume you are going to input the [vc_row] ... [/vc_row] into Toolset form content, like this:

[vc_row] ...
<label>Wysiwyg - af831d55</label>
[cred_field field="wysiwyg-af831d55" force_type="field" class="form-control" output="bootstrap"]
... [/vc_row]

If it is, then it will conduct the problem you mentioned above: those WPBakery shortcodes will be output directly in front-end, and Toolset form content don't support

And you are right, you can style the form with HTML codes. For example:

<div class="vc_row wpb_row vc_row-fluid">
 <div class="vc_col-sm-6 wpb_column vc_column_container"> <label>Wysiwyg - af831d55</label> </div>
 <div class="vc_col-sm-6 wpb_column vc_column_container"> [cred_field field="wysiwyg-af831d55" force_type="field" class="form-control" output="bootstrap"] </div>
</div>

For the CSS class names, you can check their documents, for example:
versteckter Link

#1142020

You said ...and Toolset form content don't support

So it isn't possible to put my code from WPBakery inside the [cred_field field="wysiwyg-af831d55"...
like a placeholder text?

Because it works if I input it on the forms frontend page.
But not in the backend code?

#1142040
wys-field.JPG
form-content.JPG

I meant the Toolset form content does not support WPBakery shortcode, see screenshot: form-content.JPG

But you can input the WPBakery shortcodes into wysiwyg field, and the wysiwyg field of Toolset form won't be able to display the WPBakery shortcode as HTML codes, it will display the WPBakery shortcodes directly, see screenshot wys-field.JPG

There isn't such kind feature, you might consider to make a feature request for it.

#1142052

So could you add this as a feature request?

thanks anyway
Michael

#1142075

My issue is resolved now. Thank you!