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

Make @cookieconsentbutton more customizable #43

Open
raymanP opened this issue Apr 10, 2024 · 3 comments
Open

Make @cookieconsentbutton more customizable #43

raymanP opened this issue Apr 10, 2024 · 3 comments

Comments

@raymanP
Copy link

raymanP commented Apr 10, 2024

Yet it is possible to customize the button only to some extent.
I need to add tooltips and symbol instead of button text.

E.g.

@cookieconsentbutton(action: 'reset', label: '<i class="material-icons" style="font-size: 2em">shield</i>',
  attributes: ['id' => 'reset-button', 'class' => 'btn fixed-bottom cookie-reset'],
  btnattributes: ['class' => 'btn bg-transparent', 'style' => 'margin-left: 5px; margin-bottom:5px',
    'data-toggle' => 'tooltip', 'title' => __('cookieConsent::cookies.manage')])

I added a pull request #42 for that.
Hope it finds a way to the main code. @toonvandenbos fell free to check and adapt, as you have better insight into the code.
Thanks for your work and support!

@toonvandenbos
Copy link
Member

Hi @raymanP, why not simply publish the button view and directly work in the Blade file instead?

@raymanP
Copy link
Author

raymanP commented Jun 8, 2024

Hi @toonvandenbos , I don't undestand how to get two different button versions as in ccokies.blade.php these two are used as buttons:

@cookieconsentbutton(action: 'accept.essentials', label: __('cookieConsent::cookies.essentials'), attributes: ['class' => 'cookiesBtn cookiesBtn--essentials'])
@cookieconsentbutton(action: 'accept.all', label: __('cookieConsent::cookies.all'), attributes: ['class' => 'cookiesBtn cookiesBtn--accept'])

and in app.blade.php I need the specific reset button so that the button attributes are set while in the upper cases they should not changed.
Here the button.blade.php:

<form action="{!! $url !!}" {!! $attributes !!}>
    @csrf
    <button type="submit" {!! $btnattributes !!}>
        <span class="{!! $basename !!}__label">{!! $label !!}</span>
    </button>
</form>

vs. original blade:

<form action="{!! $url !!}" {!! $attributes !!}>
    @csrf
    <button type="submit" class="{!! $basename !!}__link">
        <span class="{!! $basename !!}__label">{{ $label }}</span>
    </button>
</form>

Maybe you can give a hint how to change the button attributes only for the reset button (['class' => 'btn bg-transparent', 'style' => 'margin-left: 5px; margin-bottom:5px', 'data-toggle' => 'tooltip', 'title' => __('cookieConsent::cookies.manage')])... maybe using php programming?

@SwiTool
Copy link

SwiTool commented Aug 27, 2024

I totally agree with the btnAttributes param to the button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants