Navigation überspringen

[Gelöst] Can’t get dynamic aspect to work in shortcode

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

Problem:
Nested shortcode does not work inside elementor modules

Solution:
It seems the Elementor shortcode module you are using is not able to parse the nested shortcode.

Can you please try to follow the following steps:
- Create a new content template using Toolset (in classic mode, do not use block mode) and add the views shortcode to this content templates
- Save the content template and then try to add this content template shortcode to your Elementor's shortcode widget and check if that help you to resolve your issue.

You can find proposed solution, in this case with the following reply:
https://toolset.com/forums/topic/cant-get-dynamic-aspect-to-work-in-shortcode/#post-2233181

Relevant Documentation:

This support ticket is created vor 3 Jahre, 7 Monaten. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von chantalM vor 3 Jahre, 7 Monaten.

Assistiert von: Minesh.

Author
Artikel
#2233143

Tell us what you are trying to do?

The same issue as here but I cannot get my shortcode to work:

https://toolset.com/forums/topic/filter-view-by-post-id-of-current-post-how/
https://toolset.com/forums/topic/how-to-get-related-posts-with-a-dynamic-parent-post-id/

This is my non-dynamic shortcode that works:

[wpv-view name="category-page" wpvrelatedto="5064"]

I want to replace the number with the current post/page id but the following examples leave the apostrophe and bracket on the page:

[wpv-view name='category-page' wpvrelatedto='[wpv-post-id id="$current_page"]']

Leaves '] on the page

Have also tried it this way:

[wpv-view name="category-page" wpvrelatedto="[wpv-post-id id='$current_page']"]

Leaves "] on the page

What am I doing wrong please?

This shortcode is placed in the shortcode widget in Elementor, and works fine when just using the number. Thanks so much!

What is the link to your site?
versteckter Link

#2233181

Minesh
Unterstützer

Sprachen: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

It seems the Elementor shortcode module you are using is not able to parse the nested shortcode.

Can you please try to follow the following steps:
- Create a new content template using Toolset (in classic mode, do not use block mode) and add the views shortcode to this content templates
- Save the content template and then try to add this content template shortcode to your Elementor's shortcode widget and check if that help you to resolve your issue.

#2233271

My issue is resolved now. Thank you!