Changing Loop html structure based on tag

Hello, Ghost community!

I’m trying to make both blog and portfolio website combined.
What I want to do here is make portfolio dedicated page.
My question is if it is possible to give loops different HTML structures based on tags.
For example, posts with “portfolio” tag has loop A while other posts
loop B, general design.

Here’s my idea;

  1. make “custom-portfolio.hbs” to make a portfolio page which only displays the posts with “portfolio” tags.
  2. Edit loop.hbs and add condition by using {{#if tag=“portfolio”}}
  3. Edit default.hbs and add condition {{#if tag=“portfolio”}}

But if you know the smarter way to make it happen, I would love to hear some suggestions!

I know this can be more WordPress type of thing, but I’m a bit too fed up with fixing stuff on each update, turning the plugins on and off to troubleshoot. So it would be great if I can have potfolio+blog site on Ghost.

Hello @hiyukoim! It appears that you and I are on a similar track…

I’m working on building a collection of .hbs custom Templates and code snippets that can be shared with the community. Here is my starting point:

1 Like

Hi Again, @denvergeeks!
I’m happy to hear that you are also trying to do a similar thing.
I’m looking forward to seeing what you are building.
I’d love to get notified when it’s out.

@hiyukoim I appreciate your interest!

I’m re-posting/embedding my interesting finds from the forum onto that site as well, as I go, as they are relevant to my little projects.

I would love to hear from you as well any interesting discoveries from your learning!

P.S. Nice to have some more progesterone around here :woman_red_haired:

1 Like