The php template -
"home-pg-feed-video" =>
"<div class=\"row home-pg-feed-item pl0 pr0 ml0 mr0\" data-type=\"video\">" .
"<div class=\"col-lg-4 col-xs-4 pl0\">" .
"<a href=\"/clinical-dialogue.php?v={{ url }}\"><img src=\"{{ thumb-sm }}\" alt=\"img\"/></a>" .
"</div>" .
"<div class=\"col-lg-8 col-xs-8 pr0 \">" .
"<h4 class=\"mb5\">{{ title }}</h4>" .
"<a href=\"/clinical-dialogue.php?v={{ url }}\" class=\"watch-link\">Watch the video</a>" .
"<p>{{ summary }}</p>" .
"</div>" .
"</div>"
The link with "img" tag inside outputs correctly -
<a href="/clinical-dialogue.php?v=Dirk_Arnold_Patient_Selection_3rd_Line_&_Sequencing_Final_Branded-video.php"><img src="images/vid_thumbs/sm/Dirk_Arnold_Branded.png" alt="img"></a>
But the second link of "watch video" outputs -
<a href="/clinical-dialogue.php?v={{ url }}" class="watch-link">Watch the video</a>
The markup where I am using the template
<div class="col-lg-8 col-xs-8 col-lg-feed">
<h3 class="feed-name mt0">Featured Clinical Dialogue</h3>
<?php
for($i = 0; $i < count($featureData); $i++){
$item = $featureData[$i];
if($item["type"] === "video"){
$template = $templates["home-pg-feed-video"];
$html = $template;
foreach($item as $key => $value){
if($key == "topics") {
$value = implode(", ", $value);
}
$html = preg_replace("/{{ " . $key . " }}/", $value, $html, 1);
}
echo $html;
}
}
?>
</div>