Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Titles for posts #156

Open
cipherself opened this issue May 31, 2018 · 2 comments
Open

Titles for posts #156

cipherself opened this issue May 31, 2018 · 2 comments
Assignees
Labels

Comments

@cipherself
Copy link
Contributor

Currently all posts and pages have the same title as the title that's in the config.

Changing the relevant part of a base.tmpl of a theme to

{if $post.title}
  <title>{$post.title}</title>
{else}
  <title>{$config.title}</title>
{/if}

doesn't work, however changing it to

<title>{$post.title}</title>

works for posts' pages but the homepage will not get a title.

@Ferada Ferada self-assigned this Apr 15, 2020
@Ferada Ferada added the bug label Apr 15, 2020
@Ferada
Copy link
Member

Ferada commented Apr 15, 2020

Just ran into this myself. So, looks like I can't actually get it to work with just {$post.title} either, I wonder how that could've worked for you given that the post variable should even be available in the base template.

In any case, I'd like to get this improved, so that 1. the index page can potentially get a custom suffix in the title, 2. each generated index page can similarly describe what it's about, 3. each single post page will have the post title added as suffix.

The combinator for top-level title and "current" title can of course also be something else, though I'd even say a default to $x - $y or so would be better than the current one.

Leaves the problem that the current templating structure doesn't easily allow for that. Anyone any ideas how to proceed here? @guicho271828?

I'd perhaps suggest a (defmethod title (...)) so that each object can return its title; the top-level one can then use that and use it for the template?

@cipherself
Copy link
Contributor Author

@Ferada Sorry, that was a long time ago and I don't remember the details involved as I am not using coleslaw anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants