(How) can I customize the various pages that all use the blog layout? Can I define "sublayouts" or pass parameters? #713
-
The blog layout, of course, uses the I would like to add some customizations to these other pages. For tag pages, I'd like to be able to add a description of the tag to the top of the page (possibly linking to related tags). For months, I'd like to add "previous month" and "next month" links to the bottom of the page (which I asked about in #700). What I want to do, effectively, is to either "subclass" blog-start (tagpages and archivepages) or modify blog-start to adjust content based on the "type" of blog-start page it is. I think (but I'm not sure, because I don't know PHP) that I could find the part of the code that generates tag pages and archive pages, find where it specifies "blog-start", and change those to new layouts that I would then create. But I think I would have to clone blog-start to make the new ones, which means that if I ever want to change blog-start in the future, I'd have to do it in three places. Is there actually a way to share content among layouts (some sort of inheritance or include)? Alternatively, it seems like it ought to be possible to modify the code for these pages to still use blog-start but somehow pass the type of page along, and the blog-start layout could use conditionals to make these small additions. I've seen conditionals in the layouts, so I know that's possible, but I don't know how to pass the argument. I also don't know where I would add those tag descriptions in the content directory. Am I on the right track? Is either of these approaches possible, or is there a better way to do what I'm trying to accomplish? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think you could add in the page a setting (in the section between
and then in the layout you can put a conditional: <php if ($this->yellow->page->get("pageType")=="verybeautiful"): ?>
....
<?php endif; ?> |
Beta Was this translation helpful? Give feedback.
I think you could add in the page a setting (in the section between
---
), for example:and then in the layout you can put a conditional: