Skip Navigation

[Resolved] Shortcode with id=”$current_page displays info for loop item in 2.6-RC

This thread is resolved. Here is a description of the problem and solution.

Problem: The $current_page syntax does not appear to work as expected in the new Views 2.6-RC. Shortcodes using id="$current_page" show information about the current post in the loop, not the current page.

Solution: Update to the latest 2.6-RC2

This support ticket is created 5 years, 12 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 3 voices.

Last updated by Chris 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#741225

I am trying to:
Output a link including a taxonomy term attached to the page in which a View appears, rather than the taxonomy for the item in the View loop

Link to a page where the issue can be seen: hidden link

I expected to see:
In the first post returned in the above view ("Test Links"), the links on the post title, and "Read more" should have the term from the region taxonomy (of the page) appended. So the link should look like this:

<em><u>hidden link</u></em>

Instead, I got:
The link is getting the terms from the post itself appended, and in this case, the post has two terms, so the link is appearing as:

<em><u>hidden link</u></em>

The post title is being output using the following code in the content template:

 <h2 class="entry-title" itemprop="headline"><a href="[wpv-post-url]?from=[wpv-post-taxonomy type='region' format='slug' id='$current_page']">[wpv-post-title]</a></h2>

I'm wondering if the issue is related to the issue listed in the errata here: https://toolset.com/errata/shortcode-displays-info-view-loop-item-instead-current-page-manual-ajax-pagination/
This was resolved in Views 2.3, and indeed this shortcode does work as expected on a test site using Views 2.3: hidden link
(You'll need to enter username: "flywheel" password: "witty-language" to view that site.)

It looks like the issue was fixed for Views 2.3, but the fix possibly hasn't been rolled into 2.6-RC.

#744411

Hi, I see what you're talking about and I am investigating. I may have to reach out to my developers to see if the syntax changed and I haven't received that information, or if this is a bug. Please stand by and I will update you as soon as I can.

#747716

Juan
Supporter

Timezone: Europe/Madrid (GMT+02:00)

Hi Chris

Thanks for the feedback. This is Juan, Toolset team leader.

You are entirely right. We worked on this attribute and its syntax to etend it for post relationships as provided by the upcoming Types, and somewhere along this chnage we skipped porting this attribute value.

We just released a new beta package for Views, named RC2 (for release candidate 2) that contains a fix for this problem, and brings back support for that attribute value. If you could confirm it we would thank you a lot.

Regards.

#761759

Hi Chris, please find the RC2 plugin available for download now with a fix for the $current_page issue. Let me know if the problem is not completely resolved.

#766325

Hi Juan and Christian,

Just to confirm that everything is now working correctly with RC2.

Many thanks for your work and getting the fix out quickly!

Best wishes,

Chris

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