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

URL Fields has fixed prefixes but no optional empty option. #7242

Open
Quehnie opened this issue Jan 10, 2024 · 1 comment
Open

URL Fields has fixed prefixes but no optional empty option. #7242

Quehnie opened this issue Jan 10, 2024 · 1 comment
Labels
Feature New functionality not yet included in Sulu

Comments

@Quehnie
Copy link
Contributor

Quehnie commented Jan 10, 2024

Problem description

In some cases we have links like "Cookie Settings" in the footer which trigger a "window.cookiehub.openSettings()" javascript function. At the moment we add those static instead adding them via navigation tree on the page settings tab and using an external link.

Proposed solution

It would be cool if we get a new option in the page settings tab for the page type "external link" so we can prefix the url with our own and not given https http or tel and mail... we want to add stuff like "javascript:window.cookiehub.openSettings();"

@Quehnie Quehnie added the Feature New functionality not yet included in Sulu label Jan 10, 2024
@alexander-schranz
Copy link
Member

alexander-schranz commented Feb 13, 2024

I'm not sure if we want to support javascript: based Url in the CMS, as that could be critical from security side. What I could think about supporting maybe relative Urls or even some static Urls via an own provider.

In your case I would maybe even go with some hash based url example #cookiehub, but that would require support for relative Urls.

<a href="#cookiehub">Cookie Hub Settings</a>
window.addEventListener(
  'hashchange',
  () => {
    if (window.location.hash === '#cookiehub') {
        window.cookiehub.openSettings();
    }
  },
);

But I'm not sure if this really should be something a Content Manager should take care of or it even is more responsible of a Theme developer to always make sure that such Button/Link is always rendered in the Footer for GDPR reasons.

A workaround currently for such issue would be to Tag the specific page and then replace the url inside the code with the one you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality not yet included in Sulu
Projects
None yet
Development

No branches or pull requests

2 participants