Forum

Thread tagged as: Question, Blog

Controlling where a single blog post is displayed using blog app?

I've successfully created a blog using the helpful documentation provided. As it stands the current design is in the standard list format where each post is displayed one under another. Then you can click on each post to see the full post.

I'm having a hard time getting my head around how I would go about controlling where each individual post is displayed on a page as I'd like to experiment with the layout and have each post in a different position on the page. As the template is for the one post and it's just replicated when you create a new post I can't figure out how I would position different posts in different places on a web page.

If someone could point me in the right direction as to where I would start with something like this or if using a blog format is even the right way to go. I'm open to learning and finding the best solution.

Many thanks for your time!

David Springate

David Springate 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you need to change in the HTML to get the result you're after?

Hi

Thanks for getting back to me, as it stands I've prefixed the div containing the "blog posts" to spread across the right half of the page. I'm using Gridset to create a grid and I'd like to be able to prefix each individual post to display in different columns in order to create a more scattered grid structure.

So basically rather than the posts displaying in a list I want them to display in different positions on the page as each new post is added. I'm wondering if I have to create some sort of a 'template' that positions each one and as they get added they know where they need to be displayed.

Im really sorry if I'm not explaining this very clearly.

Many thanks.

Could you use Masonry for this? See https://grabaperch.com/add-ons/feathers/masonry

That suggestion looks interesting I'll take a look into that, thanks!

Do you have much control over how Masonry scales down responsively (where everything is positioned)?

I basically need to apply a class/prefix to each new post in order for it to be displayed in the correct columns. If I were doing it in the HTML each post would be prefixed with the correct class. I'm wondering if using repeated regions and using <perch:every> to apply a class for every 2, 3, 4 posts might control where each post sits.

Does this sound like a good solution or could anyone suggest a better approach?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, you could do that. Or you could have a field for the user to set if you need more manual control.