Site logo

Archived topic

Page Hero with content from specific categories

16 replies · Started by Sascha on August 7, 2022

Viewing posts 1–15 of 17

Hello,

I want to display a pagehero on the homepage that shows only the most recent content from a list of categories.
Below that I would like to have an area where only articles from a certain category are displayed.

I have searched a lot here in the support forum, but unfortunately have not found anything suitable.

I tried two approaches, both did not bring the desired result.

Approach 1: the homepage displays the latest posts
PageHero contains the latest content of all categories.
The area below is the same.

Approach 2: Homepage displays a static page

The static page contains the pagehero and a queryloop.
The pagehero displays no content at all.

The area below, which should only show articles from a certain category, I managed with a queryloop.
Here the articles are displayed in a container, but I would like each article to be a container so that I can change the container color.

How can I solve this problem?

Thank you very much.

Hi there,

you should use a Static Page for your Home page.
And in the page editor add a GenerateBlocks Query Loop block, set the parameters to show what posts you want.

Within the GB Query Loop, you will see the Container Block, that you can set the Background color.

Hi David,

thank you very much. That's the approach 2, so I did that.
I will have a look again for the background color of the container block.

But then I have the problem that the page hero shows nothing.
And I would like to have posts from more categories in the page hero then in the queryloop. The queryloop should have only content from one category.

If I use as data source current post and select under reading at "your homepage displays" the point "your latest posts",
then I get the latest post displayed at the page hero. The featured image is displayed as background image.

But if I select "a static page" as data source, then the page hero points to the static page.
But I want the page hero to select the latest post from several categories. So if category A has the most recent, then this one.
If C, then the post from C and so on.

Hi Sacha,

You’ll just need to add a Parameter - Taxonomies - Categories.

By default, they should be ordered from latest to oldest.

Hi Fernando,

thank you very much.

I have used that in the queryloop.

The pagehero should have the most recent content from one of these categories: Articles, Interviews, Guides.

The container below, which is filled using queryloop, should only contain content from the interviews category. I managed this using the taxonomy parameter.

Only the pagehero does not work.

In your screenshot, there’s no posts appearing.

What are your parameter for the Query Loop in the Page Hero?

What’s your structure for you Page Hero? Can you take a screenshot of your List View?

I think theres some confusion as to what you want to achieve.

The Page Hero - will this display just a single post ?

The Page Hero should always show the most recent post from several categories. Also the featured image of the post.

In the area below only posts from a certain category should be displayed.

Now I have a screenshot with additional information, where the last posts on the homepage are displayed. So no static page.
Simply so that it is more understandable what I want.

https://postimg.cc/xkdyb0yg

I think that the problem is the data provision.

If I work with the standard homepage, then I get in the red marked area all posts displayed and in the Page Hero the last from it.

If I work with the static page, which I need to display in the red marked area the posts only from the category interviews, then I can not refer the data source of the Page Hero to the current post, because that would then refer to the static page. Not even to its content.

The data source of the Page Hero seems to be the problem.

Thats the correct behaviour.
With a Page Hero you can either choose data from the current post, or from a specific post.
It won't do queries. For that you would need to add a Query Loop block inside the Page Hero.

That sounds logical, thank you.

I have now added the query loop to the Page Hero element and restricted it using the "category" taxonomy.
For testing I let it display on the home page. So the Query Loop has the data, only the Page Hero does not.

So this is how it looks on the homepage for testing: https://postimg.cc/sBYBmYMD

Here is the configuration of the QueryLoop: https://postimg.cc/JGsGvVsF

Here the configuration of the Page Hero: https://postimg.cc/QHvHr45d

I also put the QueryLoop in the container (so right before the H1 element), but nothing was displayed on the path either.

Hi there,

What David asked is to use the query loop block to replace the page hero section:
https://www.screencast.com/t/icoU6omND

You can choose the featured image as the query loop block's background image, and remove the date and excerpt.

Hope we've made it clear.

This archived topic is closed to new replies.