Angstony_2 Posted October 30, 2018 Posted October 30, 2018 I've written my own cookie policy in a CMS page and edited the EU Cookie Consent module's 'Learn more' link to point to that (/info/cookie-policy), rather than an external website. It's working, but I would like it to open in the same tab to be consistent with all other internal links. I understand that I need to remove the target="_blank"attribute, but I can't see an option to do that in the module and I can't find a document that references the link's class name (cc-link). In fact I've even searched the entire Thirty Bees github and the database for cc-link but nothing is found, so I'd be interested to learn how this document is even generated, if someone can tell me, please.
Angstony_2 Posted October 31, 2018 Author Posted October 31, 2018 I spent another hour on this today but I'm still none the wiser, so I've given up for now and just posted a feature request on the module's github repository. I know it's only a minor issue, but it bugs me nonetheless. And to my mind it should definitely be an option in settings – especially as there is no obvious way for non-coders to change the link generated – so I hope the TB devs will agree and it will get implemented at some point. In the meantime, I'm sure there must be plenty of people here with the skills to work around this issue, so I would still appreciate some help if any is forthcoming.
wakabayashi Posted October 31, 2018 Posted October 31, 2018 To be honest: I don't understand the problem. Can you show me a link to the problem?
Angstony_2 Posted October 31, 2018 Author Posted October 31, 2018 @wakabayashi Well I could provide a link, but I don't really see how that will help to explain it any better. Let me try again. I've edited the module's 'Learn more' link to point to an internal CMS page, thus: /info/cookie-policy. Now, because it's an internal link it really ought to open that page within the same tab of the browser, just like every other internal link does, but because it has the target="_blank" attribute set it's opening in a new tab. I'd like to be able to change that behaviour, but it's not possible – at least not with my extremely limited knowledge of PHP coding.
MockoB Posted October 31, 2018 Posted October 31, 2018 It is worth to check the tpl files in module's folder. Find the appropriate one and remove target=_blank attribute there, then clear the cache.
lesley Posted October 31, 2018 Posted October 31, 2018 If you wanted to get fancy with it you can make it popup in a fancy box as well.
Angstony_2 Posted October 31, 2018 Author Posted October 31, 2018 @MockoB If only it were that simple! As far as I can tell none of the tpl files that come with the module define that link. I think it's generated by a function in 'eucookieconsent.php', but that's beyond my understanding presently. @lesley That would be good too and something I'd like to learn how to do later, but for now I'd just be happy if it wasn't opening in a new tab. :)
lesley Posted October 31, 2018 Posted October 31, 2018 Actually I am not seeing a method in the API to set the link as a non _blank.
Angstony_2 Posted October 31, 2018 Author Posted October 31, 2018 Ah, does that mean what I'm asking for is impossible as things stand?
wakabayashi Posted October 31, 2018 Posted October 31, 2018 @Angstony_2 it seems to me, that this module is relying on a external js file from cloudflare. Probably they are returning the html content with the blank attribute. But this is just my guess: after looking some minutes on the code.
Angstony_2 Posted October 31, 2018 Author Posted October 31, 2018 @wakabayashi Well thanks for taking the time to look at the code. I'm afraid this is all getting a bit above my head. I'm happy to tinker with html and small doses of css, but anything more than that and my head starts hurting! :)
wakabayashi Posted October 31, 2018 Posted October 31, 2018 I don't use any cookie module myself, so I can't say much. In general I wouldn't spend too much time on such "details". Use it for important stuff like "product descriptions" or so :) Just my honest advise...
Angstony_2 Posted November 1, 2018 Author Posted November 1, 2018 I appreciate the advice, but small issues like these bring out my obsessive nature. To me, inconsistent link behaviour is a user annoyance and such things reflect badly on the company.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now