How can I change the location where the blog tag pages are displayed? #839
-
I am trying to find a solution for displaying the tag pages of my blog in a different location than intended by the system. Let me explain: What I would love to do is to to change the configuration so that my tag pages can be displayed not in root but in a folder, for example, /tag/. Unfortunately, the tag pages use blog-start as a layout file, which in my case allows only blog pages with the "home" tag to display. This is the "tagcloud"-code that generates the tags in a sidebare of a blog page:
I have succeeded in changing the URL where the tag pages are displayed by adding "normaliseArguments("tag/tag:$tag")", but this results in a 404 for root/tag/tag:$tag URL. Any ideas how I as a php-noob could change this? Any help as always greatly appreciated. Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Case solved. Instead of trying to change the layout file for tag result page, I pointed the tags toward a search query. So, in my sidebar, I have "Latest posts" (just a [blogchanges / 0] shortcode in a *.md-file. Works fine for me, and here's the code.
PS: There's only one odd thing I noticed on the search result page. The title "Search: Recent changes" now appears as h1. Anybody knows why? Cheers, Carsten |
Beta Was this translation helpful? Give feedback.
-
You can customize the layout of search results by editing the file |
Beta Was this translation helpful? Give feedback.
-
As Steffen wrote this is something you can customise in your own layout files, though it requires some basic programming knowledge. The API for developers should have everything someone needs to access pages, filter pages and handle arguments. Take a look at an extension's source code, it uses the same API, it can give you some examples of how to use it in your own layout files. |
Beta Was this translation helpful? Give feedback.
You can customize the layout of search results by editing the file
system/layouts/search.html
, or create a theme-specific layout file, e.g.system/layouts/berlin-search.html
.