I am using WHMCS (owned licensed without branding), however I want to change the layout a bit. The part I want to change is IONcube encoded, so I have to rely on Javascript (or DOM even?) to make those changes.
The ID name is: ClientAreaHomePagePanels-Active_Products_Services-0
It ranges from 0 to whatever the amount of products the customer has.
From that ID I want to change the displayed <br></br>
into {$LANG.gekoppeldaan}
Secondly; I also want to remove the href tag from that same ID, since we don't use those pages it's pointing to.
I already had some success with replacing the <br></br>
by using:
<script>
$(function() {
$('#ClientAreaHomePagePanels-Active_Products_Services-0 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-1 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-2 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-3 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-4 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-5 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-6 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-7 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-8 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-9 br').replaceWith(' {$LANG.gekoppeldaan} ');
$('#ClientAreaHomePagePanels-Active_Products_Services-10 br').replaceWith(' {$LANG.gekoppeldaan} ');
});
</script>
I somehow doubt this is a "clean" way to do this and if a customer has over 100 products, I have to create 100 of those lines. Which isn't very clean.
I haven't tried removing the href tag, simply because I don't know how.
So my question is, can someone provide some kind of clean code which replaces all
<br></br>
with {$LANG.gekoppeldaan}
for all current and upcoming ID's called ClientAreaHomePagePanels-Active_Products_Services-0
and at the same time removes the href tag/url from it.
As mentioned above the ID ClientAreaHomePagePanels-Active_Products_Services-0
increases by one for every product the customer has. So instead of adding these manually, there must be an automatic way, right? Maybe through javascript and/or DOM.
I hope I was clear enough.
//update
Thanks to Andreas (comment) and Axel I managed to get it working! Many thanks.
I used this:
<script>
$('[id^="ClientAreaHomePagePanels-Active_Products_Services-"] br').replaceWith(" {$LANG.gekoppeldaan} ");
$('[id^="ClientAreaHomePagePanels-Active_Products_Services-"]').removeAttr('href');
</script>