3

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?

1 Answer 1

2

Use that:

<a href="<?php echo $this->getUrl('my_page_url_key');?>">Link to my page</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.