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

Update title #10834

Closed
wants to merge 2 commits into from
Closed

Update title #10834

wants to merge 2 commits into from

Conversation

pebosi
Copy link
Contributor

@pebosi pebosi commented Nov 3, 2016

Suggestion for #10833

{%- if categoryTitle is defined %}{{ categoryTitle }} - {% endif %}
{%- if not isCustomLogo %}Piwik{% endif %}
{% set branding = isCustomLogo ? '' : 'Piwik' %}
{{ [title, categoryTitle, branding]|join(' - ')|trim('- ') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am getting here an error when categoryTitle is not defined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added default filter, see new commit

Add default filter
{%- if categoryTitle is defined %}{{ categoryTitle }} - {% endif %}
{%- if not isCustomLogo %}Piwik{% endif %}
{% set branding = isCustomLogo ? '' : 'Piwik' %}
{{ [title, categoryTitle|default, branding]|join(' - ')|trim('- ') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now see that there was before a check for title is defined so I'm now thinking the title might not be defined sometimes as well. To you mind adding a title|default('')?

I'm wondering if it would actually work when title and category title is not defined? Wouldn't it be maybe something like - - Piwik because it first starts with a whitespace and would be maybe not trimmed because of that? Maybe needs another trim(' - ') ?

@tsteur
Copy link
Member

tsteur commented Nov 7, 2016

BTW I have sent you an email recently. Not sure if I used right email address. Feel free to get in touch otherwise via hello at piwik.org :)

@mattab mattab added this to the 3.0.0-b4 milestone Nov 11, 2016
@mattab
Copy link
Member

mattab commented Nov 14, 2016

Hi @pebosi - in 7a815db we display Piwik at end of the title which fixed the issue as well. cheers for the PR!

@mattab mattab closed this Nov 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants