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 share pages are not specific #11506

Closed
jancborchardt opened this issue Oct 1, 2018 · 13 comments · Fixed by #49142
Closed

Titles for share pages are not specific #11506

jancborchardt opened this issue Oct 1, 2018 · 13 comments · Fixed by #49142

Comments

@jancborchardt
Copy link
Member

Screenshot of titles for share pages in browser

The titles for share pages are missing some info:

  • Shared files just show Nextcloud
  • Shared folders show Files - Nextcloud

Instead, we should show the actual names, as we also do in the header:

  • The shared file shown above should have Screenshot from 2018-01-07 00-36-09.png - Nextcloud
  • The shared folder shown above should have Screenshots - Nextcloud

It seems the title has to be passed via PHP or so, so cc @nextcloud/sharing

@jancborchardt jancborchardt added bug good first issue Small tasks with clear documentation about how and in which place you need to fix things in. 1. to develop Accepted and waiting to be taken care of feature: sharing labels Oct 1, 2018
@jancborchardt jancborchardt added this to the Nextcloud 15 milestone Oct 1, 2018
@nextcloud nextcloud deleted a comment from nextcloud-bot Oct 1, 2018
@sebastiaanspeck
Copy link

I'll take this

@sebastiaanspeck
Copy link

Where can I find the php-file where this has to be changed?

@MorrisJobke
Copy link
Member

Sadly this is partly done in PHP and then also in JS afterwards 🙈

PHP:

<?php p($theme->getTitle()); ?>

JS:

setPageTitle: function(title){
if (title) {
title += ' - ';
} else {
title = '';
}
title += this.appName;
// Sets the page title with the " - Nextcloud" suffix as in templates
window.document.title = title + ' - ' + oc_defaults.title;
return true;
},

@sebastiaanspeck
Copy link

sebastiaanspeck commented Oct 3, 2018

Correct me if I'm wrong, but the PHP-function getTitle() has to be changed and the JS-function setPageTitle has to be changed?

If so:
PHP:

return strip_tags($this->config->getAppValue('theming', 'name', $this->title));

has to be changed to use the filename or folder

JS:

appName: t('files', 'Files'),

has to be changed to use the filename or folder instead of files/Files

@MorrisJobke
Copy link
Member

has to be changed to use the filename or folder instead of files/Files

I would just change the JS side for now. This should be enough.

@sebastiaanspeck
Copy link

Okay, but how can I get the filename/folder? In the screenshot I see the string (fileId?), but how can I convert that to the filename/folder?

@MorrisJobke
Copy link
Member

Okay, but how can I get the filename/folder? In the screenshot I see the string (fileId?), but how can I convert that to the filename/folder?

Good question. Maybe @skjnldsv has an idea. I thought it is in the data attributes of <html> but it isn't.

@skjnldsv
Copy link
Member

skjnldsv commented Oct 4, 2018

@MorrisJobke I have no idea! :(
@jancborchardt do not put good first issue on stuff that touches the js from files 😬 😜

@MorrisJobke MorrisJobke removed Hacktoberfest good first issue Small tasks with clear documentation about how and in which place you need to fix things in. labels Nov 15, 2018
@MorrisJobke
Copy link
Member

Moved to 16.

@blizzz blizzz added this to the Nextcloud 25 milestone Apr 21, 2022
@blizzz blizzz modified the milestones: Nextcloud 25, Nextcloud 26 Oct 19, 2022
@blizzz

This comment was marked as resolved.

@szaimen

This comment was marked as resolved.

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 1. to develop Accepted and waiting to be taken care of labels Jan 9, 2023
@weasam
Copy link

weasam commented Mar 2, 2023

Still an issue at 25.0.4. when sharing the folder or file, the people received my sharing links in what's app or other chat platform doesn't show the title

@blizzz blizzz modified the milestones: Nextcloud 26, Nextcloud 27 Mar 9, 2023
@c-prompt
Copy link

c-prompt commented Apr 5, 2023

Unclear if this is related...

Sharing files/documents and then opening via Community Document Server/OnlyOffice/pdfviewer/etc. does not properly update document.title. Therefore, when apps like cloud_piwik (matomo) try to track analytics with the page name, the page name is almost always completely incorrect. This might be a Javascript order problem but I haven't been able to figure out as the values I'm seeing in the console for things like document.head.getElementsByTagName('title')[0], document.getElementsByTagName('head')[0].getElementsByTagName('title')[0], and document.getElementsByClassName('header-appname')[0].innerHTML sometimes reflect the appropriate document.title and sometimes not.

As a result, analytics are not accurate.

@skjnldsv skjnldsv removed this from the Nextcloud 27.0.2 milestone Aug 8, 2023
@joshtrichards joshtrichards added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Oct 29, 2024
@skjnldsv skjnldsv self-assigned this Nov 8, 2024
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 1. to develop Accepted and waiting to be taken care of labels Nov 8, 2024
@skjnldsv skjnldsv added this to the Nextcloud 31 milestone Nov 8, 2024
@jancborchardt jancborchardt moved this to 🎉 Done in 🖍 Design team Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🎉 Done
Development

Successfully merging a pull request may close this issue.

10 participants