How to stop path from Templates when setting anchors programmatically in templates?
I'm trying to implement a dynamic telephone link within a template. It does not work as it somehow forces the templating path.
For instance, I can not resolve the following: <a href="Templates/tel:+16606465978">(660) 646-5978</a> <- Notice how "Templates/" is showing in the href attribute?
<?php
$phoneNumber = '(218) 829-3278';
?>
<!-- $tellink -->
<?php
$pattern = array();
$pattern[0] = '(';
$pattern[1] = ')';
$pattern[2] = '-';
$pattern[3] = ' ';
$telLink = str_replace($pattern, '', $phoneNumber);
$fullTelLink = '<a href="tel:+1'.$telLink.'">'.$phoneNumber.'</a>';
?>
<?php echo $fullTelLink; ?>
Demo page using this code:
https://brainerd.isemanhomes.com/test.php
Now if we try to do the same in the Template, we get the addition of the unwanted path. For instance, this is the code in the actual Template which uses a dynamic value similar to the test page:
<!-- $tellink -->
<?php
$pattern = array();
$pattern[0] = '(';
$pattern[1] = ')';
$pattern[2] = '-';
$pattern[3] = ' ';
$telLink = str_replace($pattern, '', $markerTele->getColumnVal("tel"));
$phoneLink = '<a href="tel:+1'.$telLink.'">'.$markerTele->getColumnVal("tel").'</a>'; ?>
<!-- / $tellink <?php echo $phoneLink; ?> -->
<?php echo($markerTele->getColumnVal("tel")); ?>
The problem can be seen in the comment shown on this test2 page and attached screenshot:
https://brainerd.isemanhomes.com/test2.php