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

Manually open the preferences modal #3

Closed
rubsy92 opened this issue Dec 29, 2021 · 6 comments
Closed

Manually open the preferences modal #3

rubsy92 opened this issue Dec 29, 2021 · 6 comments

Comments

@rubsy92
Copy link

rubsy92 commented Dec 29, 2021

Hi,

Thank you for this library, it's amazing! I just have a question regarding the manually opening of the preferences modal. It requires a "CookieConsentService" object, which can be declared with a new statement. This new statement requires IJSRuntime which can be injected, but I don't seem to be able to figure out how I should declare the options tag. Could you add an examle of this to the readme please?

Thanks!

@RyanTT
Copy link
Member

RyanTT commented Dec 29, 2021

Hello,

glad you're finding the library useful! The CookieConsentService is part of the dependency container, so you can simply inject it where required e.g. with the [Inject] attribute.

@rubsy92
Copy link
Author

rubsy92 commented Dec 29, 2021

Hi,

Thank you for the fast reply! I got it working!

And what about the "Show cookie policy" link? Now it links to nowhere. Can I assign a link to it? Or delete that link?

Thanks again

@RyanTT
Copy link
Member

RyanTT commented Dec 29, 2021

Hi,

glad it's working!

You can change the cookie policy link with the options:

https://github.com/BytexDigital/BytexDigital.Blazor.Components.CookieConsent/blob/master/BytexDigital.Blazor.Components.CookieConsent/CookieConsentOptions.cs#L27

The options are configured inside the AddCookieConsent lambda inside your Program.cs.

@rubsy92
Copy link
Author

rubsy92 commented Dec 29, 2021

Hi,

Thanks for the fast reposonse! It's working great!

@rubsy92 rubsy92 closed this as completed Dec 29, 2021
@RyanTT
Copy link
Member

RyanTT commented Dec 29, 2021

No problem. May I ask how you found this library?

@rubsy92 rubsy92 reopened this Dec 29, 2021
@rubsy92
Copy link
Author

rubsy92 commented Dec 29, 2021

Hi,

I found it through a Reddit-post after a Google search for cookie consent in Blazor.

@rubsy92 rubsy92 closed this as completed Dec 29, 2021
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

2 participants