PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Paragraph Type Custom Fields and Create Content Template??

  1. See post: http://wordpress.org/support/topic/paragraph-type-custom-fields-not-working

    When selecting a 'Paragraph Text' field type, in a Custom Field GF field, the data is not passed to the custom post type (using the Gravity Forms + Custom Post Types). After investigation, it does not appear that the add-on is the issue.

    What caused the issue was the GF user checking Create content template and then inserting that field in the template box. So for Post Field > Custom Field was inserted. Field Label was named Entry. Paragraph Text was selected, and Create content template was checked. Inside the content template box, {Entry:8} was inserted. This always resulted in nothing being sent to the database though properly captured by GF in the GF entry. Once that box was unchecked, content was sent correctly.

    However, with Post Title, create content template was checked and inside the template was placed {Name (First):3.3} {Name (Last):3.6}, which was from the next field, and it worked every time.

    SO, is it safe to say: "So for items that you are not using content template from other fields, leave create content template unchecked."

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  2. No, you should be able to use the content template with the merge tag for the custom field itself. Although if that is the only thing you are inserting in the content template, then it's kind of silly to use the content template... it's redundant at that point. HOWEVER there does appear to be a bug when you try and do this where the value doesn't get stored. We are looking into it and will resolve it in the next release.

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  3. Hi Carl and Travis,

    The reason I used the content template with the 'Paragraph Text' field type, in a Custom Field GF field is that if I do not, the paragraph formatting WILL BE LOST when it is passed to the post.

    To be clear, what I am saying is if the user enters 4 paragraphs in a paragraph field on the form (line breaks between paragraphs), the custom field will be populated with ONE large paragraph. It loses its formatting when it comes over to the post.

    So as a remedy, I activated the content template, and selected the correct custom field from the drop down. At one point, IT WORKED. Then as I was playing with the form trying to remedy another issue in this post, http://www.gravityhelp.com/forums/topic/extra-paragraph-markup , I lost all of the 'Paragraph Text' field outputs in the post.

    I now suspect that it might be the FIELD NAMING in the content template, that WAS picking up the correct custom fields at first, then STOPPED somewhere along the line (and that detail got lost in the shuffle by me),

    So my questions are:

    1. Why is the paragraph formatting being lost on Paragraph Text fields (unless the Content Template is activated)?
    2. Does GF use the same custom field names in the selection in the content template, or convert them to another GF special format name

    Thanks much for the help!

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  4. I'm not seeing an issue using paragraph breaks in the Custom Field when using it as a Paragraph Text field. I just created a test form, with a Custom Field set to Paragraph Text. I submitted the form and then viewed the resulting post. Here is a sreenshot of the custom field that was created: http://grab.by/anDj

    You will see that the value of the custom field maintained the line breaks.

    This was done with no content template active or turned on for this field, just the plain Custom Field set to Paragraph Text with the Custom Field Name set to test.

    Gravity Forms uses no special formatting on custom field names. The drop down to select the custom field name displays an existing custom fields you already have in your database and then you can choose New to create a new one if one doesn't already exist with the name you want.

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  5. Hi Carl,
    It must be something on my end then. Here is the paragraph in the entry for the form in GF http://grab.by/anDx
    Looks good, two paragraphs.
    Here is is in the post http://grab.by/anDy
    One big blob of a paragraph.
    I'm looking into it on my end.
    I'll let you know what I find.
    Thanks

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  6. I am having trouble replicating your issue. My post custom fields are maintaining the paragraph formatting properly, even when the content template is disabled.
    If you can send me a login to your WP dashboard, I would be happy to take a closer look (alex@rocketgenius.com). Please include a link to this thread.

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  7. Alex - I'm on localhost dev on this site. I will upload it so you can see it, but it will take a bit.

    Thanks for your help

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  8. @WebDendev It looks like you are using something custom to display the custom field, which doesn't usually display in a rich text editor. It is probably related to how it loads the custom field data into the rich text editor. When I tested I just tested with the built in Custom Field interface on the Post Editor.

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  9. Hi Carl,
    I am using this https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
    to generate the meta boxes for the custom post type.
    I am registering the custom post type in functions.php, without the use of any plugin.
    That may very well be the cause.
    Let me play with that and see where I get with it.
    I will get back to you.
    Thanks much,
    Bruce

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  10. Carl and Alex,
    It is indeed how the data is loaded into the rich text editor.

    BUT - I ran another test to determine if it was the https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress code I was using.

    So I removed the meta box add for this field from the functions file.
    I then installed the Custom Field Template plugin, and created the paragraph text custom field using the plugin.
    The test post shows the data in multiple paragraphs in postmeta, and looking at it in the standard WP custom fields display in the edit post screen. Looks good in both.

    But looking at the data in the meta box created by the Custom Field Template plugin, and - back to one paragraph...

    So is it possible that the Custom Field Template plugin AND the https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress code BOTH create the text editor box in the SAME way?

    Coincidence, or another problem?
    I don't know....
    Still looking at it... any words of wisdom are very much appreciated!

    Posted 7 years ago on Friday June 17, 2011 | Permalink
  11. Hi Carl and Alex,

    As I have said in my last post, I am getting the issue of losing paragraphs with both the Custom Field Template plugin, and also https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress code.

    Surely there are many people that bring in paragraph text type fields into a post in pending status, and then want to edit the post fields in a rich text editor?

    What solution do you suggest for this?
    Thanks!

    Posted 7 years ago on Monday June 20, 2011 | Permalink
  12. I don't have a solution. The line breaks are being stored in the custom field. You can see this by viewing the custom field data itself using the Custom Field editor when editing a Post. Here was a screenshot of an example: http://grab.by/anDj

    So the data has the line breaks and the WordPress custom field editor reflects them. So the issue is going to be with how the plugin and code you are using is pulling in the data. It's not carrying over the line breaks. I'm not familiar enough with their code to know why. You may want to discuss this with the plugin author of that plugin or whoever created the code snippet.

    Posted 7 years ago on Monday June 20, 2011 | Permalink
  13. If you are wanting the stored text to display on the front end, you need to add the wpautop function on the return. if its on the back end, you need to use the WYSIWYG box and not the textarea.

    Posted 7 years ago on Tuesday June 21, 2011 | Permalink
  14. Hi Norcross,
    On the backend, I do indeed have a WYSYWYG box (tried creating two different methods - (1) https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress, and (2) Custom Field Template plugin) for each of the Gravity Forms 'Paragraph Text' type custom fields.

    Both methods do not bring the paragraph breaks into the wysiwyg editor field in the post edit screen. It is brought in as one large paragraph.
    Apparently both of these methods are handling the paragraph data incorrectly, as it looks fine in postmeta.

    Posted 7 years ago on Wednesday June 22, 2011 | Permalink
  15. Yes, Norcross you are correct (almost). The wpautop needed to be added to the backend when $meta was being called back into the wysiwyg. I have made this revision in a github fork. https://github.com/wpsmith/Custom-Metaboxes-and-Fields-for-WordPress/commit/ab540f0a9ba24d966428774c70f1e828e2926480

    Carl, there is nothing that needs to be done in GF.

    Posted 7 years ago on Wednesday June 22, 2011 | Permalink
  16. MANY thanks to Travis and Norcross on this solution!
    Hat's off to you both!

    Posted 7 years ago on Wednesday June 22, 2011 | Permalink

This topic has been resolved and has been closed to new replies.