Sign in
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Help with adding custom option

  • This topic has 2 replies, 2 voices, and was last updated 1 year, 10 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #7295
    Avatar photoGasmoN

    I managed to add “Read More” option fo technews theme. So now if I toggle it ON it will show, and if it’s OFF it won’t show.

         {{#if @config.custom.feedReadMore}}
    Read More

    All works great, now I want to add when to show that “Read More” link. For example if text exceed 20 characters.
    How can I compare that in template? What is condition for checking if string exceed X amount of characters?

    This is the code for showing content from the post.

    {{#if hasCustomExcerpt}}
       {{{ excerpt }}}
       <p>{{{ excerpt }}}</p>
    Avatar photoBob

    Why not set the excerpt length to 20?

    In the case when you need a different excerpts length look at this solution:

    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    Avatar photoGasmoN

    Thank you. But is there any way to show “Read More” button only if excerpt exceed given lengh?

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.