Skip to content

Conversation

@rolfik
Copy link

@rolfik rolfik commented Mar 22, 2020

PageTitle | ParentNamespaceTitle | ParentParentNamespaceTitle | ... | RootNamespaceTitle

PageTitle | ParentNamespaceTitle | ParentParentNamespaceTitle | ... | RootNamespaceTitle
Copy link
Collaborator

@phy25 phy25 left a comment

Choose a reason for hiding this comment

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

What is the intention of the change? Can it be acheived by using your own template? In the meantime the unit tests are failing.

global $conf;
$start = $conf['start'];

// namespace names
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess it duplicated.

Copy link
Author

Choose a reason for hiding this comment

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

?

@Klap-in
Copy link
Collaborator

Klap-in commented Mar 22, 2020

For me the purpose of the proposal is unclear as well.

@rolfik
Copy link
Author

rolfik commented Mar 22, 2020

What is the intention of the change? Can it be acheived by using your own template? In the meantime the unit tests are failing.

My intention is simple. I like title in the format described in my first post.
That is why I have shared it for anybody interested.
Tests are failing, because they test original title and not mine.
main.php change is needed to use my title format, but it can be ignored or commented out as an alternative.

Maybe later html title can be parametrized in configuration to use custom formats.

@phy25
Copy link
Collaborator

phy25 commented Mar 22, 2020

I think we need a discussion on how to improve the title if you think it needs improvement - definitely you provided what you think it can be :-).

In order to make this ready to merge, you need to modify the unit test affected by your change in the first place.

<html lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
<head>
<meta charset="utf-8" />
<title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I notice that you remove $conf['title'] from the title tag, which is a big change. Do you mind explaining why this is preferred?

Copy link
Author

@rolfik rolfik Mar 23, 2020

Choose a reason for hiding this comment

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

I use Translator plugin and actually have :start page with title same as my dokuwiki title, because it is shown also in bread crumbs navigation. So adding wiki title again would only duplicate it at the html title text end.

@Klap-in
Copy link
Collaborator

Klap-in commented Mar 22, 2020

This title is used in the tabs of the browser, and sometime in the upper bar of a window. Or in the tab choicer, if you switch tabs.
I think long titles at this place do not improve the recognizability. At my phone the max length is 40 characters in tab choicer. At tablet about 13 character in tabs of browser.

@phy25
Copy link
Collaborator

phy25 commented Mar 22, 2020

I like title in the format described in my first post.
That is why I have shared it for anybody interested.

Also I would like to point out that templates can override this title style in the way that the template developer prefers, so if you just want to customize your wiki, you can do so by creating a new template, and it can be kept across DokuWiki core upgrade.

When you submit a patch here, it will be the default for everyone using the default template, so we take it more seriously and need to judge what approach/implementation would be better.

rolfik and others added 2 commits March 24, 2020 00:20
Co-Authored-By: Henry Pan <github@phy25.com>
Co-Authored-By: Henry Pan <github@phy25.com>
@rolfik
Copy link
Author

rolfik commented Mar 23, 2020

I like title in the format described in my first post.
That is why I have shared it for anybody interested.

Also I would like to point out that templates can override this title style in the way that the template developer prefers, so if you just want to customize your wiki, you can do so by creating a new template, and it can be kept across DokuWiki core upgrade.

When you submit a patch here, it will be the default for everyone using the default template, so we take it more seriously and need to judge what approach/implementation would be better.

Well I would like to somehow keep my title style across wiki upgrades.
Copying whole template just to change one title html element seams inconvenient for me.

As I said, we could make it as an alternative of current title.
Could something like style.ini be used?

@phy25
Copy link
Collaborator

phy25 commented Mar 24, 2020

Copying whole template just to change one title html element seams inconvenient for me.

Unfortunately this is the only way you can do it without modifying DokuWiki core.

Also as I mentioned before, templates have to implement this title style in the way that the template developer prefers, so this patch would be essentially the default template's title only. A lot of templates do reimplement how this title is shown indeed, e.g. template:bootstrap3.

As I said, we could make it as an alternative of current title.

I actually don't quite see the value of such a title format. If this patch gets some thumb-ups or other collaborators see the value, we may be able to move forward.

@phy25
Copy link
Collaborator

phy25 commented Mar 24, 2020

I just thought of one approach of adding an event hook here, so plugins can override the title. If this sounds good a new issue can be created.

@splitbrain
Copy link
Collaborator

I vote for not implementing this. There are ways to implement it with your own template or you could use JavaScript to adjust it.

@rolfik
Copy link
Author

rolfik commented Mar 26, 2020

I vote for not implementing this. There are ways to implement it with your own template or you could use JavaScript to adjust it.

I have no problem with this.
Anyway I think a better approach would be to use configuration to choose title format of Dokuwiki default template like it is already done in Bootstrap3 template where my title style is one of many options.
We know that not everybody is a programmer.

@phy25
Copy link
Collaborator

phy25 commented Mar 26, 2020

As I mentioned currently template implement this themselves. There is no elegant way to force existing templates to change the title i.e. even if we implement something about this, it will not work on templates that do not adapt.

I am going to close this PR except other people have interest in this option. You can open a new issue to discuss other options.

@phy25 phy25 closed this Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants