Rock U - Content Management - Content Channels - Content Channel View
Transcribed Video Content
Okay. So we've seen how to set up your content channels. Let's look at, how you actually get them to be viewed out on the internet. So here we are on our external website. And if you remember back to the blog example, we can find the blog under, the blog menu item.
Now, this is not the most attractive looking blog but we see the items here listed below it. So now this page relies on a very, powerful block. It's called the content channel view block. And if we look at the block settings, we can see how to configure this. The first thing we're gonna do is we're gonna come up and set say what kind of channel do we wanna show items from and then also what status do the items need to be in.
Below that, there's gonna be this, area that determines what's the format or what's the template for this content channel view. Now, in this case, it's using a Lava include which basically says, hey, the Lava for this is actually stored on the file system on the web server and it's called blog item list Lava. So, let's let's just take a quick look at that. Now, when we look at it, it might seem overwhelming, but let me just kind of clear up and simplify it. Everything below here is, Lava just for paging through if there's more than five things.
So I'm just gonna delete that just for to simplify it. So all we're gonna do really is just iterate over this items collection. And items is is the content channel items. We're just gonna iterate. We're gonna spin through that one at a time.
And we're gonna store each one as we spin through in the variable item. So again, all we're doing is just a little bit of HTML around it and we're just saying, hey, put the title here. Here, we actually wanna put the summary and that's an attribute. So we use our our, filter for attributes. And then below that, we wanna have a link to get more details.
Right? So we're just gonna link to this linkedpages dot detail page and I'm gonna show you where you configure that. But just know that if I use linkedpages dot detail page, that's gonna represent the detail page that we have configured. And we're just gonna pass in the item ID. So when we get to it, we know which item we want to look at.
Okay? So I think if you just kind of simplify that, this is actually really easy. And and I think if you look back at the output, it would look pretty similar. Okay? So let's flip back over.
Okay. Next, we're gonna determine how many items per page. So we're gonna say, hey, only wanna show five per page or I wanna show 12 per page, whatever you want. Below that, we're gonna say, hey, let's cache this. caching helps speed up the content channel items.
But you have to make sure that when you cache it that you don't have any kind of personalized lava. Otherwise, you could be spitting out the wrong first name in that content. You can also choose whether or not to set the page title from the content channel item. Now, is really only useful when you have one item coming back as we'll see in the detail. When you're listing them, it's not really as useful and and it'll probably be ignored because how we're gonna set the page out.
We we have multiple items. On the other side, you can enable debug which will show you all your lava information. Choose whether you wanna merge the content. So this will first run the content through the liquid tempo thing engine to see if you actually have lava inside your content channel that you want to actually be displayed. Okay.
So we saw on the link pages, there's a detail page and this is where you actually configure it. So you'll just point at the detail page that you wanna link out to. Below that, you have the option to do some filtering. Now, this should be fairly familiar to you if you've done a data view because it's the exact same control. But we can come in here and we can actually add filter logic to this.
So if I wanted to say, in this case maybe something about the summary contains a certain word or that it has an image and maybe we want to put a a little check here so we don't show items that don't have images, you could do that. Okay. But for now, we'll just leave that, blank. We're gonna see some of these other options a little bit later, so we'll come back and look at this query parameter filtering, next. But you can have these come back in a certain order.
Okay. So in this case, it might be that you want it in order by the start date. And so this allows you to do that kind of sorting. Over here is this where you're gonna do some configuration if you're doing RSS discovery and kind of just telling it, hey, what's the meta description gonna be? Which property is it gonna be?
And and if you wanna add an image into your meta tags on the page, you can tell it which image to go ahead and throw up to that. Okay. So that's basically how to set up the the list view for a content channel. But let's cancel that and let's go actually look at one of the detail views. Okay.
So let's look at the block that does this. So look at the block settings and you're gonna find, hey, it's actually the same block. It's a content channel view block. Just a few different settings. Okay.
So same channel. We have a slightly different Lava template we're gonna come in here and use. And so let's open that one up. And it's very simple. Okay.
So in this case, all we're doing is we're, iterating over all the items, but in this case, it's only gonna be one and we're gonna show you how we know it's only gonna be one next. And we're just gonna show you the image and then we're just gonna spit out the content. Okay. So very simple. So if we come back, we're gonna see here that we've only limited our items to one per page.
Okay. So that's one way we know there is only gonna be one. We can choose to cache or not cache it. In this case, we're gonna set the page title. You might notice in the in the template Lava that we looked at, there really wasn't we really weren't, , spitting out a big title onto our page of what the the title of the content channel item was.
That's because we're relying on the page title to do that for us. Okay? And now, we get down to this last one, which is enable query root parameter filtering. And this is an important one. And so what this does is it says, hey, there's there could be some filters here.
We might have put some filters here, but I also want you to go up to the URL and I want you to look through the query string and look for things that could be filters. And so one of the things that we pass into it, if you notice at the top here, we say item equals nine. And that's just saying, hey, we we wanna find item nine and display that's results. And so it's gonna really ignore any of the filters and just say, hey, give me item nine and display that one. Okay.
And that's what another way we know there's only gonna be one item. Okay. And when we do that, this is what we get. And so, you usually generally will have, two different content channel view blocks on two different pages. One that will show you a list of content channel items and another that will show you, the content channel item detail.
Now, that's not always the case. So say for example, if we go out to the Rock website and we're to look at information on Lava. So hopefully, you've been to this page if you've done some Lava. But for example, if you go to the text filters, you'll notice, hey, wow, this is all structured content. Right?
Or a lot of it is. each one of these filters has the same properties. Right? Has a title, a description, an example which has the input, the template, the output. Well, each one of these is a content channel item.
So, for in the case of down case, the title is down case, the content is a short description and then we have some attributes, one for the data coming in, one for the lava template and one for the output. And so in this case, there really isn't a detail page. Right? We're just putting all the details right in a in order on this page. So it's not necessary that you have to have two different pages with two different content channel views, You could just have one.
But the more you look around on your website, the more you see structured content, just be thinking that's probably a good use case for a content channel view block.