Skip Navigation

[Resolved] Types shortcodes not parsed on the backend

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

Problem: I am using a 3rd-party shortcode inside a Types custom field, but when I try to display the custom field on the front-end the shortcode is not parsed. It is displayed as raw text.

Solution: For best results do not use output="raw" to display the Types field.

Relevant Documentation:
https://toolset.com/documentation/customizing-sites-using-php/functions/

This support ticket is created 5 years, 5 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)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by martinE-4 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1126986

I am trying to:
use a shortcode in a custom field (from another plugin "Download Monitor" which worked fine with Types up to and including version 3.0.5 ). However, later versions of Types after 3.0.5 broke the parsing of this shortcode in a custom field.
Link to a page where the issue can be seen:
hidden link
I expected to see:
PDF(click to download): Uniqueness of the Index Map in Banach Algebra K-theory, II
Instead, I got:
PDF(click to download): [download id="1310"]

This is one example where it didn't work, but every article page (over 100) failed. I was forced to go back to version 3.0.5 --- I haven't kept the failed version of Types active but if you need to see that I suppose I could force my site to fail briefly. Let me know...

#1127068

Hi, can you copy + paste the code used to render this field on the front-end of the site? This may include Views, nested Views, their Content Templates, shortcodes inserted in a custom page, etc.
Then please take a screenshot showing this Article Post Editor screen in wp-admin, so I can see the custom field value for this custom field. It doesn't have to be the whole screen, just the field group is fine. Include this with your next reply.

#1127073
Edit_Article_‹_Mathematical_Reports_-_Comptes_rendus_mathématiques_—_WordPress.png

Hi Christian
Thanks for the weekend reply!! Enclosed is a screen grab of the custom field in question as well as the code for the content template used to render the field. Please let me know if you need anything else.
thanks
Martin

content template code (article2): note last span statement with [types field="pdf-full-text" output="raw"][/types]

<div class="row-fluid">

  <div class="span12">
    
    <div class="customtitle">[wpv-post-title]</div>
    <div class="bordertop"><p class="alignleft">[published_hook]</p>
      <p class="alignright">[types field="published" style="text" format="F j, Y"][/types]</p>
    </div>
    <div style="clear: both;"></div>
    <blockquote>[types field="authors-full-address" separator=""][/types]	 </blockquote>
    <div><p class="borderline"><b>Abstract/Résumé:</b></p></div>
      [full_text_wpcf]
    <div class="bordertop">
      <b>Keywords: </b>[wpv-post-taxonomy type="keyword" separator=", " format="link" show="name" order="asc"]<br /><b>AMS Subject Classification: </b>
      [wpv-post-taxonomy type="ams-class" separator=", " format="link" show="description" order="asc"]
      [wpv-post-taxonomy type="ams-class" separator=", " format="link" show="name" order="asc"] 
      <div class="bordertopbottom">
      [restrict paid="true"] [/restrict]

<span STYLE="color: green; font-size: 16px; font-family: Helvetica;"><b>PDF</b>(click to download):<span>[types field="pdf-full-text" output="raw"][/types]</span></span>

      </div>
    </div>
  </div> 
</div>
#1127092

What happens if you remove the output="raw" from the Types field shortcode? Is the stored shortcode executed or still written out?

#1127148

Yes Christian! That was it! I removed the output="raw" from the shortcode and it works now for the current Types version. Thanks so much for your fast advice!

#1127149

My issue is resolved now. Thank you!

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