Sign in

Help with adding custom option

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

    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>

    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!


    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.