Having learnt in "Templates for Items in Directory Sites video" to use Toolset single text for a description, and built that page.
I then watched "Creating a View in WordPress video" and cant use excerpt of post as described.
Ive seen a post about shortcode, but I bought Toolset as all the videos said I don't need to learn code.
Is there a workaround to this yet as Im sure others have followed the training and come up against this problem?
What is the link to your site?
hidden link
Thanks
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Jay,
Thank you for getting in touch.
Based on your query i'm assuming that you want to display the text that has been stored in your excerpt field correct?
If so can you try using the single field block and selecting the Post excerpt as the field to get the value from. See Screenshot.
Please try this and let me know if it helps.
Thanks,
Shane
Hi Shane
Thanks for replying.
Sort of, but the text is in a toolset single field not the standard WP text field.
Thanks
Jay
I wonder can i mix and match information, and would it get indexed / archived correctly.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Jay,
Not sure what you mean by this
Sort of, but the text is in a toolset single field not the standard WP text field.
Can you provide a screenshot of what you mean ?
I wonder can i mix and match information, and would it get indexed / archived correctly.
Mix and match which fields ?
Please let me know so that I can provide a bit more clarity for you.
Thanks,
Shane
Hi Shane,
I was sure i answered and posted yesterday, but it doesn't appear.
What i am after is the ability to have a toolset "single field" display an excerpt from a toolset "fields and text" field.
The option for excerpt is only available to standard Word Press text / paragraph.
This tells how to deal with it but I cant code.
https://toolset.com/forums/topic/create-excerpt-from-custom-field-2/
So there is a solution, It's just I cant implement it.
I was wondering if anybody else had found an easy workaround.
Thanks
Jay
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Jay,
Thank you for the clarity. I believe I understand what you are saying now.
This is a shortcode that i made which involves the use of our Toolset shortcodes being used instead of the single field block.
Here are the steps to get it working:
1. Copy the code below to the Toolset custom code section in Toolset -> Settings -> Custom Code and create a new custom code.
// Add Shortcode
function shorten_string( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'length' => '',
'string' => '',
),
$atts
);
return substr($atts['string'], 0, $atts['length'])."...";
}
add_shortcode( 'shorten_string', 'shorten_string' );
2. Ensure that after you've saved the snippet you've clicked the activate button.
3. Go to your template that you want to add the excerpt to and then use the shortcode like below. The code should be added into the Classic editor block.
[shorten_string string="[types field='ingress' output='raw']" length='50']
Where [types field='field-slug-goes-here' output='raw'] is the shortcode to get the values from your Types field. Replace the "field-slug-goes-here" with the actual slug of your custom field.
Please let me know if this was able to help you resolve the issue.
Thanks,
Shane
My issue is resolved now. Thank you!
Thanks so much, I not as scared of code as i was before.