Skip Navigation

[Resolved] Call shortcode in a view attr

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 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 2 months ago.

Assisted by: Minesh.

Author
Posts
#2778523

I use a taxonomy view, inside of it i call another view to take all items within this taxonomy so i can create tabs.
But i also wanna take only items that is related to current page parrent.

[wpv-view name="modules-page-content" wpvmodulecategory="optional" wpvrelatedto="[getRelationedCourse]" wpvmoduleyear="[wpv-taxonomy-slug]"]

this is the shortcode (doing it for an example):
function getRelationedCourseFN( $atts, $content = null ) {
$atts = shortcode_atts( array(
'id' => get_the_ID()
), $atts );
$id = $atts['id'];
$output = "1600";

return $output;
}
add_shortcode('getRelationedCourse', 'getRelationedCourseFN');

and this is what i get to the front:
" wpvmoduleyear="year-1"]

#2778536

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I would like ot know where you are adding this view's shortcode?

Are you using any page builder or anything such?

Can you please share problem URL where you added the shortcode as well as admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

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

#2778664

Minesh
Supporter

Languages: English (English )

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

On your edit layout page:
- hidden link

Can you please tell me where you added the view to what layout cell?

#2778671

In the second row from the bottom.

#2778672

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

You will have to register your shortcode name at:
=> Toolset => Settings => Front-end content => Third-party shortcode arguments section and I've registered your custom shortcode name getRelationedCourse

More info:
- https://toolset.com/documentation/legacy-features/views-plugin/shortcodes-within-shortcodes/#third-party-shortcode-ar

#2778673

Perfect. Is working now.
Thank you!