Custom page in navigation

I created a custom page and added it to the theme (contents/pagename/single.html) but I can’t figure out how to add this custom page to the navigation. I tried the search, but couldn’t find the answer. BTW, I am using TinyTheme.

If you use the native Pages, you just get this include switch. Unless you need a dramatically different template, I would not place it how you did in the theme.

However, if you want a fully custom layout, what you want is the page in layouts/pagename/single.html then you want to put in content/pagename.md a page that only has YAML front matter with:

title: PageName
type: PageName

1 Like

Tiny Theme now has a handy microhook to add custom navigation links to the beginning or end of the menu you already have. Tiny Theme: Microhooks

It also has a microhook to disable its built-innavigation, if you need to start from scratch.

I feel like I tried this and it didn’t work, but perhaps I did something else wrong. I will give this a try again!

Thanks for the link, I will take a look at the Microhooks. They look simple enough.

So if I just create the page using the native pages feature, and then have my template at layouts/reviews/single.html, the page is blank.

You cannot use native pages + a fully custom layout like that. You either have to embed the page in your theme by making a layout.+ a content/*.md file with the right type in your theme or make a native page. You should only touch your theme if it needs a distinct layout. Even then, I’d consider if that layout can be achieved with something like a custom short code, which can be used in a native page.

Got it! I’ll take a look at custom short codes to see if they would work. I essentially just need a tweaked version of an archive page that includes only specific categories.

I appreciate the pointers!

Are you sure you don’t already get this page by going to /categories/reviews? Category pages (which are effectively the Archive page without a list of categories, if I recall) exist by default.

You can edit a category page layout with /layouts/categories/terms.htmlif you want to tweak that. And if you want to find that page at a "nice" URL, I just recommend using the URL forwarding for/reviewsto/categories/reviews`.

For example, I didn’t do anything to get this page.

I’m looking for a single page with posts from three specific categories, grouped by category.

Yeah, to be honest, I’d probably do a short code that took a category as a parameter for what you want, then just put three of those short codes on a custom page, one calling for each category you want, in that case. I do something similar for json.blog/books which uses a bookshelf shortcode I use, and I give it a shelf name per short code. New year comes, I just add an additional call to the short code.

My Books page has this as the full content:

{{< bookshelf shelf="currentlyreading" title="Now" >}}

{{< bookshelf shelf="readin2024" title="Read in 2024" >}}

{{< bookshelf shelf="readin2023" title="Read in 2023" >}}

{{< bookshelf shelf="readin2022" title="Read in 2022" >}}

{{< bookshelf shelf="readin2021" title="Read in 2021" >}}

{{< bookshelf shelf="readin2020" title="Read in 2020" >}}

{{< bookshelf shelf="readin2019" title="Read in 2019" >}}

{{< bookshelf shelf="readin2018" title="Read in 2018" >}}

{{< bookshelf shelf="readin2017" title="Read in 2017" >}}

{{< bookshelf shelf="readin2016" title="Read in 2016" >}}

{{< bookshelf shelf="readin2015" title="Read in 2015" >}}

{{< bookshelf shelf="readin2014" title="Read in 2014" >}}

Thank you! That’s what I’m leaning towards right now.

Update: It’s working great. Thanks for the suggestions.