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.

Customize li (list) after submit using gfrom.

  1. Hi im trying to markup all my post (recipes) using schema.org/Recipes.

    Im have 1 poblerm only. With My Form , i have two List Field.

    1. List Field for ingredients list.

    2. List Field for recipe instructions list (step by step)..

    How to add more stucture in li that?

    EXAMPLE (What i want)

    See this screenshoot OR this post Source.

    Current li

    See this post source.

    THANKS GRAVITY FORMS SUPPORT TEAM.

    Posted 11 years ago on Tuesday December 11, 2012 | Permalink
  2. David Peralty

    I'm sorry, I still don't understand what you want or why it has to do with Gravity Forms. Where is your form to submit recipes? Can you post any code samples of what you've already done to pastebin and link me to them?

    Posted 11 years ago on Tuesday December 11, 2012 | Permalink
  3. My form is here: http://webresepi.com/tulis/
    PUBLIC USER TESTER LOGIN DETAIL
    Login : malika
    pass: antasyah

    =============================================

    Currently on ingredients section, Gravity Forms only send to post entry like below

    <ul class="bulleted">
    <li>udang putih 500g</li>
    <li>cili giling ( 4-5 sudu)</li>
    <li>bawang putih (ditumbuk atau dicincang kasar)</li>
    <li>bawang merah (ditumbuk atau dicincang kasar)</li>
    <li>bawang besar (dihiris bulat)</li>
    <li>kicap</li>
    <li>sos cili</li>
    <li>serbuk perasa</li>
    <li>gula</li>
    <li>garam</li>
    </ul>

    =============================================
    How to insert itemprop="ingredients" inside Ingredients li like below, when user submit post:

    <ul class="bulleted">
    <li itemprop="ingredients">udang putih 500g</li>
    <li itemprop="ingredients">cili giling ( 4-5 sudu)</li>
    <li itemprop="ingredients">bawang putih (ditumbuk atau dicincang kasar)</li>
    <li itemprop="ingredients">bawang merah (ditumbuk atau dicincang kasar)</li>
    <li itemprop="ingredients">bawang besar (dihiris bulat)</li>
    <li itemprop="ingredients">kicap</li>
    <li itemprop="ingredients">sos cili</li>
    <li itemprop="ingredients">serbuk perasa</li>
    <li itemprop="ingredients">gula</li>
    <li itemprop="ingredients">garam</li>
    </ul>

    Ingredients on my forms is Bahan Ramuan

    THANKS GRAVITY FORMS SUPPORT TEAM

    Posted 11 years ago on Tuesday December 11, 2012 | Permalink
  4. It sounds like you need to modify the post body before the post is created. Gravity Forms will collect the information for you and it sounds like that is working for you now. Can you past a copy of your content template at pastebin.com or pastie.org so we can see how you are creating the post body?

    Posted 11 years ago on Thursday December 13, 2012 | Permalink
  5. Hi Chris, Yes that i mean.

    Paste copy of my content template like this your mean?

    Ok now, i have paste my Gform Content Template at this permalink http://pastebin.com/vQBUBUNG

    Posted 11 years ago on Friday December 14, 2012 | Permalink
  6. Hi Chris,

    please tell me if that is not what you want.

    THANKS GRAVITY FROM PLUGIN SUPPORT TEAM.

    Posted 11 years ago on Saturday December 15, 2012 | Permalink
  7. Hello. I tried to load that pastebin link but it came up blank. Can you double check the URL and paste it here again. That is what I meant, the content template. I want to see how you are adding the list to your post body right now.

    Posted 11 years ago on Tuesday December 18, 2012 | Permalink
  8. I was able to get the pastebin link to load: looks like they had a temporary problem. Sorry about that.

    Can you tell me which field merge tag is the one which provides the list of ingredients?

    I don't think we will be able to modify the list the way you want to, before the post is created, but maybe we can update the post after it's created using the gform_after_submission hook.

    Posted 11 years ago on Tuesday December 18, 2012 | Permalink
  9. Hi Chris thanks for reply,

    I can load and view my pastebin on http://pastebin.com/vQBUBUNG this. Or optional i have paste on http://pastie.org/5546314.

    but maybe we can update the post after it's created using the gform_after_submission hook.

    Glad to hear that :D , how to do?

    Thanks thanks

    Posted 11 years ago on Tuesday December 18, 2012 | Permalink
  10. Hello Chris, im still waiting for your reply, hope you do not mind to help ;)

    THANKS GRAVITY FORM SUPPORT TEAM

    Posted 11 years ago on Friday December 21, 2012 | Permalink
  11. Which merge tag and which portion of the content template is the one which provides the list of ingredients. We'll have to modify each of the list items, possibly after the post is created. But I'm not sure which field we're working with.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  12. Hi Chris, lets try. but i know how to do (step)..

    I want its show on my post like below:

    <ul class="bulleted">
    <li itemprop="ingredients">udang putih 500g</li>
    <li itemprop="ingredients">cili giling ( 4-5 sudu)</li>
    <li itemprop="ingredients">bawang putih (ditumbuk atau dicincang kasar)</li>
    <li itemprop="ingredients">bawang merah (ditumbuk atau dicincang kasar)</li>
    <li itemprop="ingredients">bawang besar (dihiris bulat)</li>
    <li itemprop="ingredients">kicap</li>
    <li itemprop="ingredients">sos cili</li>
    <li itemprop="ingredients">serbuk perasa</li>
    <li itemprop="ingredients">gula</li>
    <li itemprop="ingredients">garam</li>
    </ul>

    OR like this

    <ul class="bulleted">
    <li><span itemprop="ingredients">udang putih 500g</span>/li>
    <li><span itemprop="ingredients">cili giling ( 4-5 sudu)</span></li>
    <li><span itemprop="ingredients">bawang putih (ditumbuk atau dicincang kasar)</span></li>
    <li><span itemprop="ingredients">bawang merah (ditumbuk atau dicincang kasar)</span></li>
    <li><span itemprop="ingredients">bawang besar (dihiris bulat)</span></li>
    <li><span itemprop="ingredients">kicap</span></li>
    <li><span itemprop="ingredients">sos cili</span></li>
    <li><span itemprop="ingredients">serbuk perasa</span></li>
    <li><span itemprop="ingredients">gula</span></li>
    <li><span itemprop="ingredients">garam</span></li>
    </ul>

    OR like this

    <ul class="bulleted">
    <span itemprop="ingredients">udang putih 500g</span>
    <span  itemprop="ingredients">cili giling ( 4-5 sudu)</span >
    <span  itemprop="ingredients">bawang putih (ditumbuk atau dicincang kasar)</span >
    <span  itemprop="ingredients">bawang merah (ditumbuk atau dicincang kasar)</span >
    <span  itemprop="ingredients">bawang besar (dihiris bulat)</span >
    <span  itemprop="ingredients">kicap</span >
    <span  itemprop="ingredients">sos cili</span>
    <span  itemprop="ingredients">serbuk perasa</span >
    <span  itemprop="ingredients">gula</span >
    <span  itemprop="ingredients">garam</span >
    </ul>

    whether any of the above formats can be created with gravity forms list fields?

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  13. Talking with one of the developers today we came up with a solution to filter the merge tag before the post is created. We will use the gform_merge_tag_filter:
    http://www.gravityhelp.com/documentation/page/Gform_merge_tag_filter

    It looks like field 5 in your form ({Bahan Ramuan:5:}) is the one where the list of ingredients will come from. Please take a look at this code: http://pastebin.com/b4beTcV9

    Add that code to your theme's functions.php (you may not need the opening <?php tag depending on where you add it.) That should alter the list of ingredients to add your itemprop. Let us know if this works for you.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  14. Whow, thanks Chris...

    I Have try this functiuon on my site. But its not working.. itemprop="ingredients" atribute still not show up.

    I feel strange, why only class atribute will show up in my post entry if put on custom template. atribute id, itemprop or other atribute is not show up in my post entry when i put on custom template...

    SAMPLE IF ON MY GFROM CUSTOM TEMPLATE LIKE THIS

    <div class="gambar_resepi" id="picture">
    <a href="{Upload Gambar:2:full:url}"><img  id="pic" itemprop="image" class="photo" src="{Upload Gambar:2:full:url}" tittle="{Tajuk Resepi:4}" alt="{Tajuk Resepi:4}" /></a>
    </div>

    its will show on my post entry only like this

    <div class="gambar_resepi" >
    <a href="{Upload Gambar:2:full:url}"><img  class="photo" src="{Upload Gambar:2:full:url}" tittle="{Tajuk Resepi:4}" alt="{Tajuk Resepi:4}" /></a>
    </div

    only class without id="picture" , id="pic" and itemprop="image"

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  15. What is the role of the author who you are assigning the posts to? Some roles do not have the ability to post all that HTML. Please try giving the author of those posts which are created by form submission another role with more permissions, like Author, Editor or Administrator, and see if the HTML is still being stripped.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  16. Hi Chris,

    Thanks it works if its written (using gform) by aministator. But not working if its written (usgin gform) by Author or Subscriber.

    Anyway how fix this? any tips how to setting my User Role Editor Plugin for my Author or Subcriber?

    Thanks thanks Chris

    Posted 11 years ago on Sunday December 23, 2012 | Permalink
  17. You need to give permission to the author role to use HTML. You need a plugin like Members, by Justin Tadlock, to edit the role. There are lots of plugins which will allow the same thing, but Members is a good one and well supported.

    http://wordpress.org/extend/plugins/members/

    I believe the capability you want to give them is "unfiltered_html".

    Posted 11 years ago on Sunday December 23, 2012 | Permalink
  18. Hi Chris,

    This issued fix after tick "unfiltered_html" on setting my User Role Editor Plugin.

    Thanks so much for help.

    Posted 11 years ago on Monday December 24, 2012 | Permalink
  19. Very nice. Glad you were able to work that out.

    Posted 11 years ago on Monday December 24, 2012 | Permalink

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