How to create a post template which fetches posts by tag

1. create an override folder: https://getpublii.com/dev/theme-overrides/

2. copy the config.json to the overrride folder and add something like

"postTemplates": {
  "portfolio": "portfolio filter"
},

as described here: https://cv.domagic.site/posts/alternative-post-template-with-filter-for-publii-cms

3. duplicate the index.hbs and move this copy to the override folder. Rename it to post-newname.hbs, as described here: https://getpublii.com/dev/how-to-create-custom-templates/

4. The post-newname.hbs will be used as a post template. Create a post and choose the template: 

5. I built this template to show all posts regarding my trip to Mallorca, so I named the post template "mallorca filter", as it shows posts with the tag 'Mallorca', only.

To achieve this, follow the instructions: https://getpublii.com/dev/how-to-display-posts-connected-with-a-specific-tag-name/

Find the the {{#each post}} helper and replace it with 

{{#each @website.contentStructure.tags}}

and add 

{{#checkIf this.name '==' 'TAGNAME'}}
    {{/each}}
    {{#if this.postsNumber}}
    {{#each this.posts}}

Replace TAGNAME with the tag you want to show/filter. Use the name, not the slug, in my case Mallorca, not mallorca.

Find the closing helper part {{/each}} and put the following code right before the helper:

{{/each}}
{{/if}}
{{/checkIf}}

 

 

Change Brackets default browser

By default Live preview is set to Google Chrome Browser. To change this
- Go to Debug
- Open Preference file and
- change this line from “livedev.multibrowser”: false to “livedev.multibrowser”: true.

Close the Brackets App and open it again.

Click on the “Live Preview” and it will start in your default browser like Safari or any other browser.

A list of all the Godzilla movies in chronological order

1. Godzilla (1954)
2. Godzilla Raids Again (1955)
3. King Kong vs. Godzilla (1962)
4. Mothra vs. Godzilla (1964)
5. Ghidorah, the Three-Headed Monster (1964)
6. Invasion of Astro-Monster (1965)
7. Ebirah, Horror of the Deep (1966)
8. Son of Godzilla (1967)
9. Destroy All Monsters (1968)
10. All Monsters Attack (1969)

Weiterlesen

Cucumber Gin and Tonic

Ein klassischer cooler Longdrink, der ganz einfach zuzubereiten ist:

  • drei bis vier Eiswürfel in ein hohes Glas geben,
  • 30 Milliliter Dry Gin hineingießen,
  • drei Gurkenscheiben (geschält oder ungeschält, ganz nach Wunsch) hinzufügen
  • und mit 180 Milliliter Tonic Water aufgießen. Fertig!

Die übliche Zitronenscheibe lassen wir weg, aber wer mag, kann einen Zweig Basilikum hinzufügen.