Skip Navigation

[Resolved] Shortcode inside another shortcode doesnt work

This support ticket is created 3 years, 10 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 9 replies, has 2 voices.

Last updated by Nigel 3 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1683147

Hello everyone, everything good?

I need help that I can't solve.

I am developing a website using your plugins: types, views, maps and forms. I am not using layouts and I will not use them, because the theme I use (impreza) is very good and it already comes with the template creator, which is excellent.

This site is a membership site, where I have several CPTs and some of them users will be able to edit.

My problem is precisely in the content editing part.

In your tutorial, you say to create a content template, but as I said, I will not use the layouts. And I'm using the classic view editor, not the block editor.

However, I thought of a simple solution that I need your help.

Follow the reasoning please:

1 - I created a post editing form and put it on any page (ex: "/editpostpage"), with this shortcode: [cred_form form='editformname' post='999'], it works perfect, but only edit the post with id 999.

2 - I created a view on another page, showing the posts, and created a link for each item like this: "/editpostpage?idpost=[wpv-post-id]", this link takes you to the page of the editing form.

3 - I installed this plugin: hidden link who allows me to get the values ​​of the url parameters, it works perfect.

4 - registered the shortcode of the plugin above, in the toolset settings.

5 - I changed the shortcode of the page with the editing form and it was like this: [cred_form form='editformname' post='[urlparam param="idpost"]'], however it did not work.

Everything seemed perfect, however, the URL Param plugin shortcode does not seem to work within the Form's shotcode, even registered in the toolset settings.

It shows an error message, and at the end of the message these characters appear: " '] " and this is usually associated when the shortcode inside the other does not work.

Could you help me solve this?

I'm waiting.

Thank you

#1683385

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

You don't need a third-party plugin to get values of URL parameters, you can use the Toolset shortcode wpv-search-term (https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-search-term).

I think if you use that then it should work for the post attribute in the cred_form shortcode.

#1683883

Hi Nigel,

I made a replacement for your indicated shape, but it didn't work either.

The code looks like this:

[cred_form form='form-edicao-rel-fin-annual' post='[wpv-search-term param="idpost"]']

It gives the same error message.

How can we proceed?

Thank you

#1684651

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I just tested this and it worked initially but any further edits I made to the page containing the form broke it, because the Classic block switched back to Visual mode and inserted p tags that broke the shortcodes.

So I switched to using a Custom HTML block instead of the Classic block, which doesn't interfere with the markup, leaving the shortcodes intact.

Can you try again with that?

#1685261
Capturar2.PNG

In fact, what I'm using is wpbackery and placing the shortcode inside the same html block. follow the attached image.

#1685273

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

I thought you were inserting a cred_form shortcode onto a page.

Your screenshot is for something else.

#1685361

excuse me,

I really sent the wrong print.

but the structure is the same, the only thing that changes is the shortcode, the second block of html, is that:

[cred_form form = 'form-edicao-rel-fin-annual' post = '[wpv-search-term param = "idpost"]']

I'm waiting

#1685371

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

OK, thanks.

In those screenshots it looks like you are adding the shortcodes to an HTML module.

Could you test adding them to a Text module instead, in text mode?

If that doesn't work, can you test adding them directly to a page which does not use WP Bakery? I'd like to confirm that they should be working, and that the problem specifically relates to WP Bakery.

#1685613

Hi Nigel,

Man, I managed to solve it.

The problem was the HTML block of the page builder, I just changed it to normal text and it worked.

Still, thanks for the help.

See you

#1685645

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

OK, good, that's what I asked you to do, so, pleased that it worked, thanks for confirming.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.