Skip Navigation

[Résolu] Excerpt field possible in CRED?

This support ticket is created Il y a 8 années et 3 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Marqué : 

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

Last updated by Dido Il y a 8 années et 3 mois.

Assisted by: Shane.

Auteur
Publications
#351187
table.jpg
custom post.jpg
Form.jpg

Hi, I am working on a CRED form.
I like to add an excerpt field,

Advertentietekst: [cred_field field='excerpt' length="3000"]

but this does not work in the form.
is there a solution?

The output of the form:
hidden link
and: hidden link
Form: hidden link

The meaning of this field is that I like to have 1 textfield. But with a normal textfield I can't make an excerpt. With an excerpt I can limit the lenght for the post and for the table.

#351249

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Dido,

In order to restrict the characters in your excerpt section we will need to do this with some custom code since it is not supported by wordpress nor our CRED plugin.

Add the following to the js editor on your cred form.

 
(function($) {
    $.fn.extend( {
        limiter: function(limit, elem) {
            $(this).on("keyup focus", function() {
                setCount(this, elem);
            });
            function setCount(src, elem) {
                var chars = src.value.length;
                if (chars > limit) {
                    src.value = src.value.substr(0, limit);
                    chars = limit;
                }
                elem.html( limit - chars );
              	remainder = limit - chars;
                $(".remainder").html(remainder);
            }
            setCount($(this)[0], elem);
        }
    });
})(jQuery);
var elem = jQuery("#chars");

 
jQuery("textarea[name='post_excerpt']").limiter(500, elem);

This should limit the post_excerpt field to 500 characters. If you want to lower or increase this value just modify the 500 in the code.

Also if you want to see the remainder characters left just add this to your form.

<p class='remainder'></p>

Please let me know if this helps.

Thanks,
Shane

#351266

Hi Shane,
what will I use in the CRED form?
[cred_field field='excerpt' ] does not work, no field in the form

#351268

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Dido,

To add the post excerpt field go to "Add Post fields" button on your Cred form edit page then select "Standard Post Fields" here you will be able to see the button for your post excerpt field.

Please let me know if this helps.

Thanks,
Shane

#351345

Hi Shane, unfortunatelly the exerpt field is not between the options. Maybe I must create and use an custom textfield?

#351443

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Dido,

I believe the reason why this isn't showing up is because when creating a new CPT in types the excerpt section is disabled by default 🙁

You will need to enable it by going to Types -> Post Type and then scroll down to "Custom Post Properties" and then enable the excerpt section by clicking the checkbox and then hit save.

Once you have done this then the excerpt section should now appear and you can then follow the instructions here https://toolset.com/forums/topic/excerpt-field-possible-in-cred/#post-351268

Please let me know if this helps 🙂

Thanks,
Shane

#351458

I had this field activated and allready use it too.

So this is not the solution. Can you maybe take a look into the site?

#351499

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Dido,

Yes please allow me to have access to check on this.

The private fields have been enabled.

Thanks,
Shane

#351526

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2015-12-03 at 4.18.28 PM.png
Screen Shot 2015-12-03 at 4.18.34 PM.png

Hi Dido,

Thank you for the credentials,

I checked on the issue and noticed the field has already been enabled like you said. I was also able to see the button to add the excerpt shortcode to your form.

I also attached a screenshot of the excerpt section already in use.

Please let me know if this helps.
Thanks,
Shane

#351530

O, I have overlooked this because I expected the term "Excerpt" !
Sorry for that.. but it works fine now!
Thank you again.

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