Disable link click on a ccount module box

Open to all! Ask other shopowners for help.
Post Reply
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Disable link click on a ccount module box

Post by radhavallabh »

Hi dear;
I am using the 1.1.0.2 version, I need disable link click on a account module,
for example if we take this GDPR account module-

Code: Select all

$GLOBALS['Template']->_data['account']['gdpr']['links'][$this->group] = [
            'title' => MODULE_CONTENT_ACCOUNT_GDPR_SUB_TITLE,
            'link' => $GLOBALS['Linker']->build('gdpr.php'),
            'icon' => 'fas fa-address-card fa-5x',
To disable I tried-

Code: Select all

$GLOBALS['Template']->_data['account']['gdpr']['links'][$this->group] = [
            'title' => MODULE_CONTENT_ACCOUNT_GDPR_SUB_TITLE,
            'link' => NULL,
            'icon' => 'fas fa-address-card fa-5x',
But this link then redirects to the index page, instead of disabling the link hover.

Please can you point me in the right direction on how to disable it.
Thank you in advance;
Very Warm Regds./
radhavallabh


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Disable link click on a ccount module box

Post by burt »

Without a link how will people find the GDPR page?

Why not just turn the module off?
I am not here to build for you.
I am here to build with you. Let's help each other.
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Disable link click on a ccount module box

Post by radhavallabh »

burt wrote: Wed May 14, 2025 12:21 pm Without a link how will people find the GDPR page?

Why not just turn the module off?
Actually I just used a example of GDPR as I mentioned,
I want use this idea on another module dear,

Basically Trying to display information in a box with disabled clicking;

Your kind help will be deeply appreciated
Thank you in advance
Very warm Regds/
radhavallabh
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Disable link click on a ccount module box

Post by ecartz »

There is no provision for disabling a link. What you're passing is the href of the link. If you don't pass one, you'll just have an empty href.

You could use a hook to add JS at the end of the page that disables or removes a link. Of course, that's a client side operation that people could bypass. Better would be to allow them to click the link and have it go to a page with no actions that just displayed the same information. Then if you want to disable that link on the client side, you could.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply