Sign in

How to insert a HTML snippet/widget/shortcode/partial into blog post contents?

  • This topic has 1 reply, 2 voices, and was last updated 1 week, 6 days ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9094
    Avatar photorugby

    I would like to create a HTML widget with variable title and insert it into multiple blog posts contents using the WYSIWYG editor. For example I want to add to the post body:

    {{> banner title=”Buy now!”}}

    But how to do it? Should I make a helper (.js) or a partial (.hbs)? How to tell Publii to include the HTML snippet in place of the shortcode? Is it possible to add a button to the editor toolbar which will insert my widget (like e.g. gallery, media)?

    Thanks in advance!

    #9103
    Avatar photoBob

    Have a look at this topic: https://forum.getpublii.com/topic/global-string-variable/ also at https://getpublii.com/dev/how-to-create-custom-handlebars-helpers/#how-to-create-custom-handlebars-helpers

     

    --
    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!

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