Page 1 of 1

Disable link click on a ccount module box

Posted: Wed May 14, 2025 12:13 pm
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

Re: Disable link click on a ccount module box

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

Why not just turn the module off?

Re: Disable link click on a ccount module box

Posted: Wed May 14, 2025 12:39 pm
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

Re: Disable link click on a ccount module box

Posted: Wed May 14, 2025 1:37 pm
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.