• ♡ Sponsor

    findFirstParagraph

    #Find

    Finds the first paragraph tag in a rendered HTML string and returns its content. This function can be used to extract the first text block form a block variable to be used separately as a teaser text for the page in a pagelist. To get the first paragraph of a Markdown variable, the markdown functions has to be applied before.

    @{ +blocks | findFirstParagraph }
    

    The first paragraph within a Markdown variable can be extracted as follows:

    @{ text | markdown | findFirstParagraph }
    

    Related

    Pipe  ⁄
    findFirstImage — Pipe

    Finds the first image tag in a rendered HTML string and returns the src attribute. This function can be used to extract the first image form a block variable to be used separately in any other place like a teaser section of a page card in a pagelist. To get the first image of a ...

    • Automad
    • Developer Guide
    • Building Themes
    • Template Language
    • Pipe
    • findFirstParagraph
    Discuss
    Packages
    Release Notes
    Support
    Terms of Use
      Become a Sponsor
      GitHub
      Twitter
      Facebook
      Instagram
      2013-2023 by Marc Anton Dahmen
    Released under the MIT license

    A faceless machine, creating one's portrait in the internet.
  • Automad
  • Getting Started
  • System
  • User Guide
  • Developer Guide
  • Headless Mode
  • Discuss
  • Packages
  • Developer Guide ←
  • Building Themes ←
  • Template Language ←
  • Pipe
  • ceil
  • dateFormat
  • def
  • escape
  • findFirstImage
  • findFirstParagraph
  • floor
  • markdown
  • match
  • replace
  • round
  • sanitize
  • shorten
  • stripEnd
  • stripStart
  • stripTags
  • strlen
  • strtolower
  • strtoupper
  • ucwords