Hi.
In your tutorial Creating content hubs with Ghost, you’re showing an example with two routes using the same template file for two different channels:
How would you go about displaying a channel title, let’s say “Photography”, using that template? You have to do it somehow because you’re using the same template for two different channels.
There is no mention in your documentation that there is a channel data object with some properties to use.
Furthermore, how to get a page title using that template? I’m getting a pagination page as a title, “Page 1”, which is not something you’d like to see.
Thank you for this, it’s a good idea, but I think it doesn’t solve the broader issue. It would work only if channel = tag. The whole point of having a channel is that you can mix tags, or create a content hub, as it is called. So, correct me if I’m wrong here, if I have a mix of tags within a channel, data: tag.photography wouldn’t work.
Sure! That’s totally fair, in that case you could potentially create a page to hold all the data you want to use for the channel - and then use data: page.photography-meta to load it in
Thank you John. What would then I will be using for template property for this channel in routes.yaml? Page slug? Or the same template that I will be using for the page?
Sorry, John but no luck.
I have a page named photography-meta with slug photography and a custom route /topic/photography/ in the routes.yaml file as my channel with controller, filters, template and data properties.
If I go to the page URL (/photography/) then I get page meta inside the template but no posts, which is cool since there is no channel at this URL.
If I go to custom route URL (/topic/photography/), then I get 404.
Sorry to trouble you but as a Ghost newbie, I’m at loss here.