Forum
Blog Layout
Hi there,
Just needing a little nudge in the right direction. I'm looking to create a blog layout like this > https://tribalmedia.co.uk/blog/
I was wondering what is the best way to tell perch to always place the latest post up top and with a bigger image?
Thanks for the help :)
If you're doing a listing, you can use
Thanks Drew, much appreciated.
I've got the 'featured post' listed out and styled separately but it' still outputting it to the list below, so i've a duplicate post situation going on...any ideas?
You've got something very muddled happening with your
before
andafter
tags. Make sure everything is correctly nested.Hi Drew,
Sorry to be a pain, but i can't seem to figure this one out. Any changes i make to the nesting causes the layout to break.
I know this is probably out with the scope of your support. But, could you pin point where I've gone wrong?
Thanks again,
Here's an example from neat the bottom:
Depending on the result of the
if
, you'll either have an opening<perch:after>
or not. You always have a closing one. So sometimes it'll be valid and sometimes not. I'm having trouble following the logic of your template.Hi Drew,
Thanks for getting back to me on that. You were right, it was a complete mess. I've tidied it up the best i can and it's now displaying the correct way but it's still not 100% there.
It's stopped duplicating the 1st post (yay) and is listing out the remaining items underneath the 'featured post' but now the code outputs the items (small-4) outwith it's parent div (main-content).
Any ideas?
I think you possibly need to move that div within the
else
section. It's currently outside it:Hi Drew,
Thanks for getting back to me on this. I tried that previously and it didn't' work. What happens there is the 'main-content' div gets repeated, so all the news items are piled onto of each other instead of repeating within 'main-content'.
Not sure if it'll be helpful but here's a link to the site.
Thanks again.
Can you reduce it to a simple test case?
Sure thing, Drew. I've stripped it down to the bare bones.
How about this?
Tried that as well. But when i did, the featured-article works just fine but for the lower articles it repeats the "main-content-container" (which is set to width 100%) with every new post, creating a stacking effect.
The way we had it before creates the exact layout i'm looking for but it doesn't render "small-articles" within "main-content-container".
I'm really stumped on this one. Thanks again for all your help.
p.s - not sure if you meant to remove the <perch:before> tag but i gave that a go just in case and it caused all kinds of craziness.
Tried this as well
Which outputs this html
So that way only works for the second latest news post but then anything older falls outwith the "main-content-holder".
Ah, ok.
That's the one! Thanks Drew.
Ugh, so simple. Oh well, lesson learned. :)
Thanks again.