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

Cookiebar Inserttags renders unnecessary <div> #240

Closed
5 tasks done
FlowinBeatz opened this issue Dec 16, 2024 · 4 comments
Closed
5 tasks done

Cookiebar Inserttags renders unnecessary <div> #240

FlowinBeatz opened this issue Dec 16, 2024 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed stale Issue is stale because it did not have activity for a long time

Comments

@FlowinBeatz
Copy link

Prerequisites

  • I checked for duplicate issues (open and closed)
  • I am using the latest stable version/release of the Contao Cookiebar
  • I made sure that my own template changes, CSS or JS do not interfere with the Contao Cookiebar
  • This issue contains only one bug.
  • This issue is not a question, not a feature request and I have read the documentation and pinned issues

Please select the topic(s) that most closely match your concern

Frontend (CSS/JS)

What operating system(s) are you seeing the problem on?

macOS, Linux

What browser(s) are you experiencing the problem on?

Chrome

Description

When I use the {{cookiebar::show}} Inserttag, the resulting <a> Tag is wrapped in an <div class="block">.
Because it's a realistic scenario that people will include this Inserttag in their data privacy statements within an <p> tag (which is automatically generated by TinyMCE) this results in sloppy HTML output.

<p>
<!-- TEMPLATE START: vendor/oveleon/contao-cookiebar/contao/templates/cookiebar/ccb_opener_default.html5 -->
    <!-- indexer::stop -->
    </p>
<div class=" block ">
<a href="javascript:;" class="ccb-trigger ccb-prefill" title="" rel="noreferrer noopener">Change privacy settings</a>
</div>
<!-- indexer::continue -->
<!-- TEMPLATE END: vendor/oveleon/contao-cookiebar/contao/templates/cookiebar/ccb_opener_default.html5 -->
<p></p>

Relevant log output

No response

@FlowinBeatz FlowinBeatz added bug Something isn't working unconfirmed labels Dec 16, 2024
@zoglo zoglo added this to the 2.1 milestone Jan 2, 2025
@zoglo zoglo added help wanted Extra attention is needed good first issue Good for newcomers 2.x Version 2.x and removed unconfirmed labels Jan 2, 2025
@zoglo
Copy link
Member

zoglo commented Jan 2, 2025

As briefly discussed on Slack @FlowinBeatz you should be able to create a new template such as ccb_opener_default_raw.html5 without the extends and adjust the line where the template gets used.

You can already change your ccb_opener_default and modify it in your case.

If you also want this to be included in 1.x, you should open a separate PR when doing the same for 2.x

@zoglo
Copy link
Member

zoglo commented Jan 8, 2025

@FlowinBeatz can we still count on your PR?

@zoglo zoglo added the stale Issue is stale because it did not have activity for a long time label Jan 8, 2025
@FlowinBeatz
Copy link
Author

@zoglo When this is not a wanted default behavior there shouldn't be a PR?

@zoglo
Copy link
Member

zoglo commented Jan 21, 2025

@FlowinBeatz It's something that can be improved upon and this can be considered an issue, that's why I labeled the issues as a bug.

The insert-tag should not render an additional div but can use it's own template.
We don't use the feature so it doesn't affect us, hence adding the good first issue and help wanted label as well.

TL;Dr:
Feel free to create a PR, also a separate one for 1.x if that should still go into 4.13 since there won't be any unnecessary nor complex upstreams anymore.

And if you don't need it, leave the issue open, maybe someone else will see this one day and create a tested PR 😊

@zoglo zoglo removed this from the 2.1 milestone Jan 21, 2025
@zoglo zoglo added enhancement New feature or request and removed bug Something isn't working 2.x Version 2.x labels Jan 28, 2025
@zoglo zoglo closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed stale Issue is stale because it did not have activity for a long time
Projects
None yet
Development

No branches or pull requests

2 participants