I have the following code in a html file.

<div><span data-bind="i18n: 'insurance condition'"></span> <a href="https://example.com/index.php/sales-and-delivery-terms" target="_blank" data-bind="i18n: 'condition link'"></a></div>
<input type="checkbox" name="extra_fee_flag" class="checkbox" id="extra_fee_flag" value="1"/>
<span data-bind="text: getExtraFeeLabel()"></span>
<span> &nbsp; + </span>
<span data-bind="text: getFormattedPrice()" class="price" style="font-weight: 600"></span>

in the A tag, I have a hardcoded link to the sales and condition page which is a CMS block. How can I get the url of this page dynamatically so even one day the url is change in the admin, this link will still be working?

有帮助吗?

解决方案

Use that:

<a href="<?php echo $this->getUrl('my_page_url_key');?>">Link to my page</a>
许可以下: CC-BY-SA归因
scroll top