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

Not possible to set an id for the a-tag in the TinyMCE #6618

Closed
mlwebworker opened this issue Dec 11, 2023 · 11 comments
Closed

Not possible to set an id for the a-tag in the TinyMCE #6618

mlwebworker opened this issue Dec 11, 2023 · 11 comments
Labels
Milestone

Comments

@mlwebworker
Copy link

Affected version(s)

4.13 und 5.2

Description

Für den a-Tag im TinyMCE lässt sich keine ID setzen - auch dann nicht, wenn man explizit noch einmal die ID in den Sicherheitseinstellungen beim a-Tag erlaubt. Wenn man versucht für das a-Tag in der Quellcodeansicht des TinyMCE eine ID zu setzen, dann wird diese nach dem speichern komplett gelöscht. Eine Klasse funktioniert. Auch das Setzen einer ID für andere Element z.B. p-Tag funktioniert.
Siehe dazu auch https://community.contao.org/de/showthread.php?86062-id-Attribut-im-Anker

Ist das aus Sicherheitsgründen notwendig oder ein Bug?

@fritzmg
Copy link
Contributor

fritzmg commented Dec 12, 2023

Hast du es auch in der TinyMCE Config erlaubt?

@mlwebworker
Copy link
Author

Da es nicht mein Problem ist und ich es nur für jemanden aus dem Forum gemeldet habe, hatte ich es bei mir nicht mit Anpassung im Tiny getestet. Hatte ich bisher gar nicht auf dem Schirm.
Habe jetzt folgendes in dem angepassten Template stehen:

<?php $this->extend('be_tinyMCE'); ?>

<?php $this->block('valid_elements'); ?>
    extended_valid_elements: 'q[cite|class|title],article,section,hgroup,figure,figcaption,a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|data-lightbox|id]',
<?php $this->endblock(); ?>

Damit funktioniert es.
Wäre es nicht sinnvoll das vom Core her schon zu implementieren, zumal es scheinbar früher möglich war, die id im a-Tag zu verwenden? Spricht da etwas dagegen?

@fritzmg
Copy link
Contributor

fritzmg commented Dec 12, 2023

What exactly is the use case?

@mlwebworker
Copy link
Author

Im Fall im Forum werden vom Fließtext Fußnoten angesprungen und von den Fußnoten kann wieder zurück in den Text gesprungen werden.
Wie gesagt ich habe den Fall nicht. Deshalb kann ich auch nur dieses Beispiel anbringen.

@fritzmg
Copy link
Contributor

fritzmg commented Dec 12, 2023

Sounds very specific to me and thus adjusting the be_tinyMCE template is the correct solution 👍

@mlwebworker
Copy link
Author

Für mich ok. Irritierend für Nutzer ist es immer, wenn etwas, dass früher funktioniert hat jetzt nicht mehr funktioniert.

@fritzmg
Copy link
Contributor

fritzmg commented Dec 12, 2023

The TinyMCE version has changed frequently with Contao and with that features always were added, removed or changed.

@mlwebworker
Copy link
Author

Ich denke, dann sollten wir es lassen wie es ist und wer das braucht muss es halt im Template anpassen.

@fritzmg fritzmg reopened this Jan 16, 2024
@fritzmg
Copy link
Contributor

fritzmg commented Jan 16, 2024

This might be a regression caused by #5559

I am not sure what changed, but when reverting #5559 data-lightbox still works - and so do things like id, rel and style (/cc @aschempp).

@fritzmg fritzmg added this to the 4.13 milestone Jan 16, 2024
@mlwebworker
Copy link
Author

Kann das unter Umständen auch noch davon abhängen, welche Version des Tiny MCE installiert ist? In der 4.13 ist das doch nicht zwingend einheitlich oder täusche ich mich da.

@fritzmg
Copy link
Contributor

fritzmg commented Jan 16, 2024

I could not reproduce it with TinyMCE 4 either.

Closing in favor of #6721

@fritzmg fritzmg closed this as completed Jan 16, 2024
leofeyer pushed a commit that referenced this issue Jan 16, 2024
Description
-----------

This reverts commit 46339e0.

Fixes #6618

It is unclear why this was necessary in the first place. All attributes, including `data-lightbox`, `id`, `rel` and `style` for example, work out of the box with our current default TinyMCE configuration.

Commits
-------

cee8368 Revert "Allow data-lightbox in TinyMCE by default (see #5559)"
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants