Skip Navigation

[Résolu] Syntax Display Plugin – what does Toolset use?

This support ticket is created Il y a 6 années et 6 mois. 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Marqué : 

This topic contains 5 réponses, has 2 voix.

Last updated by tony Il y a 6 années et 6 mois.

Assigned support staff: Luo Yang.

Auteur
Publications
#401255

I am trying to: display some code syntax on a web page and have tried using plugin SyntaxHighlighter Evolved

Unfortunately the code that I want to display contains Toolset shortcodes and these are being expanded so the result is unpredictable.

Please can you tell me what you use to display the code that we send. I know it is contained in

The code I want to display is:

<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#[wpv-post-title]">Modal Edit</button>
<!-- Modal -->
<div id="[wpv-post-title]" class="modal fade" role="dialog">
  <div class="modal-dialog modal-lg">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
        <h4 class="modal-title">
        [wpv-post-title]
        </h4>        
      </div>
      <div class="modal-body">
        [wpv-post-body view_template='None']           
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>

and I want to be able to copy/paste the code to my templates/views/posts and pages with line feeds intact and no additional code added.

Thanks
Tony

#401266

I found the line that was causing most of my problem:

[wpv-post-body view_template='None']

When removed I had the correct lines showing but the shortcodes such as [wpv-post-title] were being expanded. I can find a solution by removing them but it would be nice if they can be retained.

Tony

#401465

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Dear Tony,

Where do you put above codes into?
Could you describe more details for the question:
I want to be able to copy/paste the code to my templates/views/posts and pages with line feeds intact and no additional code added.

If it is theme file, you can use wordpress function do_shortcode() to render the both View shortcodes:
[wpv-post-body view_template='None']
[wpv-post-title]

More help:
https://developer.wordpress.org/reference/functions/do_shortcode/

And there is a build-in feature within Views
Content Templates – Custom Designs for Single-Pages without PHP
https://toolset.com/documentation/user-guides/view-templates/
Content Templates let you create your own templates can help you create your own template for single post

#401475

The code is put into the standard Edit field in a Post

This is my test page
hidden link

I will be out now for 3-4 hours so please note no quick response from me.

Thanks
Tony

#401488

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

What is the standard Edit field in a Post?
Is it post body?
You can not use the shortcode [wpv-post-body view_template='None'] in the post body, it will produce infinite loop problem.

I suggest you try with content template, see demo site:
1) Create a content template with the codes, you mentioned above:
hidden link
user/pass: xgren/111111

2) Edit the single post, in section "Content template", choose above content template
hidden link

See the result:
hidden link

It works fine, I can not see the problem:
These are being expanded so the result is unpredictable.

If you are using above codes in a Views loop, you can specific the content name in shortcode [wpv-post-body], for example:
[wpv-post-body view_template='syntax-display-plugin-what-does-toolset-use']

More help:
https://toolset.com/documentation/views-shortcodes/#wpv-post-body

#401913

Thanks Luo

I have found a solution for what I need to do.

Tony