Sign in

Example not working for me. How to sense what template I am using?

  • This topic has 2 replies, 2 voices, and was last updated 2 years, 6 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5371
    Avatar photopublii-slpa

    I am trying to use…

    {{#checkIf template '==' "MYTEMPLATE"}}

    …but am not sure what value to use.

    Cuurently, I have one head partial per post index, author, post, tag as index-head.hbs, author-head.hbs, and so on.

    I am trying to create a single head.hbs where I can sense which template I am using and changing the contents within a div tag.

    I have tried post, post-head, post.hbs, post-head.hbs as examples.

    None of these seem to work.

    I also see…

    {{template}}

    and within a…

    {{#post}} {{/post}

    … returns nothing. I used this to try and figure out what value I should use in the checkIf example.

    No such luck-

    Are there any clues as to what should replace MYTEMPLATE to sense if the template is index, post, author, or tag?

    Cheers!!

    #5374
    Avatar photoshaun2k

    I believe you can use the {{#is}} helper.

    Have a look at https://getpublii.com/dev/is-helper/#is-helper

    #5375
    Avatar photopublii-slpa

    Cheers Mate!!

    Brilliant!

    I will give this a shot in the AM. (Yes I know it is already the AM.) 😉

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