1

I am trying to set the href attribute of an <a>-Tag inside a template string but it does not work.

function createLink(object) {
return `<a href="${object.DetailActionUri}">Detail</a>`;
}
2
  • What is object.DetailActionUri? And when you say it’s not working... how? We can’t read your mind. Commented Feb 21, 2021 at 13:44
  • This is form a TYPO3 extension and object.DetailActionUri contains the Uri to an action which i created in the Controller and gave it as a property to my object. The function "createLink" is called within the Fetch API. I was receiving a TYPO3 page not found error, even though the URI worked when i copied and pasted it to the URL-bar of my browser. The problem was, that i forgot to delete some TYPO3 Viewhelpers inside the template string. After deleting them, the link works now when i am clicking on it. Commented Feb 21, 2021 at 13:53

1 Answer 1

0

The template string also contained some TYPO3 Viewhelpers, which caused that the link did not work. After deleting them, the link is working now.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.