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.

What does hasCustomExcerpt refer to?

  • #4566
    Avatar photo[anonymous]

    On the page I see the post tag:


    What does this refer to?

    I have poked around and found nothing so far.

    Avatar photoBob

    If you want to view more than just an excerpt, you can use the Read More button in the editors. Then the selected part of your post will be displayed in place of the excerpt:

    Avatar photo[anonymous]

    Thanks for the reply.

    I will have to fiddle about to see if this answers my latest question.


    Avatar photo[anonymous]

    It seems that…


    …is not available to the tag page which is where I would want to use it.

    Avatar photoBob

    It is related to posts, also displayed on the tag pages.

    Avatar photo[anonymous]

    It does not seem to be available in the head section — head.hbs. Is this the case?

    Avatar photoBob

    It must work here:

    {{#if hasCustomExcerpt}}{{{ excerpt }}}{{else}}{{{ excerpt }}}{{/if}}
    Avatar photo[anonymous]

    Here is what I see…


    …am I missing something?

    Avatar photoBob

    I don’t know why it doesn’t work for you, I would have to access the files to see all the code, etc … but I don’t really have time right now to debug what’s wrong.

    Avatar photo[anonymous]


    I get that you do not want to debug the code. I am sure you are busy.


    Avatar photo[anonymous]

    Okay. I created a textarea under postConfiq and it seems to work within the post body, however, not within the head.hbs.

    This leads me to believe that {{excerpt}} and the textarea text I created are not available within partials.

    I can see a real need for this. This could be important for schema markup and possibly other interesting uses.

    Are there any other avenues to chase down to achieve my goal??


    Avatar photoBob

    I don’t feel like arguing, as I said,  it works very well here, what you can check here:

                   "@type": "Question",
                   "name": "Highlight your code syntax with Prism.js",
                   "acceptedAnswer": {
                   "@type": "Answer",
                   "text": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent viverra nec ligula non cursus. Vestibulum tellus elit, auctor luctus ligula eget, egestas venenatis purus. Nulla at tortor tristique est egestas viverra ac non risus. Curabitur euismod ut urna a pulvinar. Praesent vel nisi vitae felis dictum luctus. Phasellus id velit non tortor porttitor tempor. Etiam accumsan urna ac leo hendrerit fermentum.</p>
    <h2>Translations API</h2>
    <p>Quisque viverra dapibus metus, quis pulvinar massa ultricies sed. In lobortis imperdiet dui non tempus. Aenean vel accumsan erat. Fusce gravida et odio vel convallis. Aenean convallis sagittis ligula at imperdiet. Pellentesque fringilla arcu eu elit convallis, nec euismod neque molestie. Pellentesque imperdiet porta ligula, sed fringilla massa. </p>
    <p>Phasellus at nisl eu turpis tincidunt posuere non non odio. Nullam luctus arcu non orci pretium vehicula et sit amet augue. Proin ac rhoncus nibh, et maximus lacus. Ut risus elit, cursus eget libero sit amet, aliquet iaculis augue. Integer non quam lectus.</p>

    In terms of using postConfig outside the post context, use postViewConfig

    Avatar photo[anonymous]

    Good Lord- Whos arguing?

    I asked, If I was missing something?

    Clearly I was. I was asking for guidance to help find the answers. Keep in mind, I am an old-school coder, however, when something is new, you are over-washed with too much information in too many places. Connecting the dots when they are all over the place, one can easily miss something simple. I was asking, What am I missing? That is all. You answered that today.

    I really do appreciate your help. I am sorry you feel frustrated as you clearly seem to be. That was surely not my intent. Believe me I get it. I have been on your side of the fence before.

    Keep in mind, if I did not think the world of your product, and you for that matter, I would not have looked so long for a solution. I am choosing Publii for for some of my work over my own fully object.oriented CMS that I wrote primarily for large-scale automated sites serving very many millions of pages — though fully capable of serving small sites too. In fact, it served all of my sites. I just shut down one hack attempt research site a couple of years ago with over 50 million pages. Just think, Publii is my top choice for the rest of my work. That means — you are clearly doing something right.

    Chin-up buddy! You’re okay. You are doing good work — and I appreciate it.


    Avatar photoBob
    publii-slpa wrote:

    Good Lord- Whos arguing?

    Hehe, sometimes I lose my nerves, that’s true, especially when I see such messages:

    Back to the topic, I am fallible but I am also a co-creator of Publii so please trust me when I say something should work or not. Please send me your site backup, I will try to check it this weekend.

    Avatar photo[anonymous]


    I trusted you when you said it should work.

    I got it — finally. You gave be a clue this morning that I somehow missed.

    I will update the other post to include more details on what I have done with code so that others can do the same thing.

    I know I was frustrating! Believe me, I get it! The fault lies on my end too. Trust me, I see it. I apologize. I can be obtuse. 😉

    Congratulations on such an impressive app. It is truly fascinating! It is extremely well imagined. Great job!


    Avatar photo[anonymous]

    Hi @publii-slpa,

    I was wondering if you could share your findings regarding hasCustomExcerpt

    I am trying to display excerpts for selected posts in hero image slider on the frontpage. However, using excerpt would truncate according to the “Excerpt length” in the theme’s basic settings. The “Excerpt length” for each post may not be desirable as the truncation may happen in odd places of a sentence which is not too elegant.

    If those selected posts have customExcerpt, then it would be possible to display the desired excerpt text completely.