fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
488 stars 301 forks source link

Long URLs in SOUR PUBL Causes Layout Issues in the Source List #4973

Open samiona2 opened 8 months ago

samiona2 commented 8 months ago

The PUBL of a SOUR can have very long URLs (with parameters). When the URL is very long, the Source List will render the Publication very wide without scrollbars. This makes some of the data not visible over the margin that can't be scrolled. I was able to address the issue by removing empty parameters that were not needed, but this can be an issue if all of the data in the URL is needed.

FrankWarius commented 8 months ago

I have changed app/Factories/MarkdownFactory.php in my installation and now render links so that they end after the URL and parameters are not shown.

e.g. https://www.ancestry.de/sharing/2712362?mark=c78a30b6caca40410f94da380cdb9012f6383830a08b9bdae5a1fe2fe93d3cfa is displayed as https://www.ancestry.de/sharing/2712362

see https://github.com/FrankWarius/webtrees/commit/53ee506be226471695a2f485c9e75c58613b450b (I know this does not comply with the code guidelines)

kiwi3685 commented 8 months ago

When I add the above URL to the PUBL of a SOUR, then look at the Source List, I see that the URL as wrapped to fit whatever space is available. So no scrollbars or code changes seem to be necessary. See attached image.

I tested this on the webtrees Demo - Current release, in all the standard themes. Are you perhaps using a different theme to the standard set, or have modified one?

Or, is it a unique to one browser?

Whatever the issue, it is only a display issue. So if necessary that can be fixed just with css (using the "CSS/JS" module already in the Control panel). Something like:

<td.d-md-table-cell { max-width: 30px; } span.ut a { max-width: 95%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; }

Screenshot 2024-03-29 at 2 11 56 PM
samiona2 commented 8 months ago

I am using the standard webtrees theme. It does not wrap long URLs. My assumption is that it should either wrap, or truncate it with an ellipses and show the full one on a hover.

kiwi3685 commented 8 months ago

The image I attached is from the webtrees.net demo site ("current release"). It shows that the url does wrap.

Can you provide an image of the problem from your system?

Norwegian-Sardines commented 7 months ago

A couple of points: 1) I agree with kiwi3685, in the demo system the URL does wrap. Therefore no webtrees code change is necessary. Disable all add-ins and test again. 2) I think you are using the PUBL tag incorrectly.

a) The PUBL tag contains text information about the Publication. GEDCOM says:

For published works, this includes information such as the city of publication, name of the publisher, and year of publication. For an unpublished work, it includes the date the record was created and the place where it was created. For example, the county and state of residence of a person making a declaration for a pension or the city and state of residence of the writer of a letter.

b) Ancestry is not the Publisher of most (if not all) information on its website, they are the "Repository" of the information published by other individuals and/or entities. If I was to include the URL of the location I found information, the link would be stored in the Source_Record.REPO.CALN tag. In webtrees this location will actually provide a hyperlink to the URL page.