Tagged: 

Viewing 13 reply threads
  • Author
    Posts
    • #9148
      redsoxfan99
      Participant

      So I have inherited a WordPress site built on PikList which I have never worked on before. We I try to place a salesforce shortcode for a form in the content editor it is not working. Again, I am brand new to Piklist, any help would be greatly appreciated. I am running WP 4.9.7 and Pkilist version 0.11.4. on Linux server.

      Attachments:
      You must be logged in to view attached files.
    • #9158
      Steve
      Keymaster

      @redsoxfan99– Welcome to the Piklist community! We’re here to help.

      I’m not clear on the second screenshot. Is it partially rendering the shortcode?

      If you place the shortcode in the TEXT tab, instead of VISUAL, does it work better?

    • #9161
      redsoxfan99
      Participant

      Steve thanks for the welcome and quick response. I have placed the shortcode both ways in visual and text and saved the page and still the same. I placed some plain text in there to show you that content is being pulled over just the shortcode is not being processed correctly.

      Attachments:
      You must be logged in to view attached files.
    • #9165
      Steve
      Keymaster

      Can you post the code thats creating the salesforce shortcode? A good place to post is: https://gist.github.com/

    • #9166
      redsoxfan99
      Participant

      I am a bit confused. This shortcode is from this plugin: https://brilliantplugins.com/downloads/salesforce/

      I am not creating a shortcode. I am using the one provided by the plugin.

      Let me know if you need anything else.

      Thanks again for the help.

    • #9183
      redsoxfan99
      Participant

      OK after weeks of no support I am not sure what to do. I have inherited this site that uses piklist. The page uses a piklist editor but when I place a short code from a salesforce form plugin, the editor just dumps out the shortcode. So I tried another short code and the same. The Piklist Editor is not processing the shortcode and sees it as normal text. I have saved the shortcode multiple times in the Piklist editor and nothing. The shortcode DOES WORK in the Normal WordPRess Editor but not the PIKLIST Editor. Can someone please help.

      This is NOT a shortcode I created within Piklist. This is a shortcode from another plugin. We have an option on a page where it uses a PIKLIST Editor to enter extra content.

      Attachments:
      You must be logged in to view attached files.
    • #9185
      Steve
      Keymaster

      How are you outputting the shortcode in the front of your site?

    • #9186
      Steve
      Keymaster

      If you want WordPress to render your shortcode on the front of your site, you need to use this WordPress filter:
      https://developer.wordpress.org/reference/hooks/the_content/

      Something like this should work:

      
      $speaker_request = get_post_meta($post->ID, 'your-custom-field-name');
      echo apply_filters('the_content', $speaker_request);
      

      The standard WordPress editor automatically calls this filter, but you need to do it manually,

      This will not fix the shortcode not rendering properly in the admin, but it will work on the frontend.

    • #9187
      redsoxfan99
      Participant

      Steve,

      thanks for the information. Again being new to Piklist, I see a WYSIWYG Editor in WordPress I assume that placing a shortcode there would get processed correctly. Thanks for letting me know that when you have an Pikslit Editor you have to do the extra step to process the shortocde. I guess when I was looking at the files, the original author has this code for the Editor and so I assumed that shortcodes would be working as when you look at the array options I see shortcode_buttons = true and wpautop = true.

      function tab_fields($index = 0) {
        return array(
          array(
            'type' => 'text',
            'field' => 'tab_title',
            'label' => 'Tab Title',
            'columns' => 12
          ),
          array(
            'type' => 'editor',
            'field' => 'editor_content',
            'label' => 'Post Content',
            'template' => 'field',
            'options' => array(
              'wpautop' => true,
              'media_buttons' => true,
              'shortcode_buttons' => true,
              'teeny' => false,
              'dfw' => false,
              'quicktags' => true,
              'drag_drop_upload' => true,
              'tinymce' => array(
                'resize' => false,
                'wp_autoresize_on' => true
              )
            ),

      I will give it a try.

      Thanks,

      Darren

    • #9188
      Steve
      Keymaster

      This is the way WordPress works. It has nothing to do with Piklist. If you want WordPress to process your shortcodes then you need to output with the filter. It’s the WordPress way

    • #9189
      redsoxfan99
      Participant

      So when I create a custom template, I can just call WordPress function ‘the_content()’ and if a shortocde is in the the MAIN WP Editor it gets displayed without have to use the filter. screenshots attached. So I do not understand your reasoning. On this page, I can place the Salesforce Form Shortocde in the Pages Main WordPRess Editor and it works. But this page has meta boxes below the Main Editor and has been coded to display a Piklist Editor. When I place the same shortcode in the Piklist Editor is not processing the shortcode correctly.

      So I think we might be getting confused. Looks like the original developer created a custom template with custom Piklist fields to create an editor.

      Attachments:
      You must be logged in to view attached files.
    • #9193
      Steve
      Keymaster

      WordPress adds this filter for you when you use the_content():
      https://core.trac.wordpress.org/browser/tags/4.9/src/wp-includes/post-template.php#L240

    • #9194
      redsoxfan99
      Participant

      Correct. I understand this. So the Piklist Editor does not do this?

    • #9195
      Steve
      Keymaster

      the_content() is a WordPress function that OUTPUTS data. Piklist doesn’t have custom functions to output data. We let you use normal WordPress functions like get_post_meta().

Viewing 13 reply threads
  • You must be logged in to reply to this topic.