0

first of all... thanks for the help.

I have in my Blogger template certain Anchor elements that I have to convert to another element type because I have problems with a JS code and I can't find another way besides changing the element.

It has helped me to change from <a> to <p> and place inside it onclick="location.href = '#link';" instead of href="#link" (it does almost the same function):

Before: <a href="#link">clickme</a>

After: <p onclick="location.href = '#link';">clickme</p>

But how could I do this on a element if the link is obtained through a part of code that is only understood by the Blogger API?

It would look something like this:

<a expr:href='data:post.url'><data:post.title/></a>

And convert it to:

<p onclick="location.href = 'data:post.url';"><data:post.title/></p>

But so far, I don't know what it takes to make it work...

Danii R
  • 11
  • 1
  • Really sounds like you should try to fix the issue with your (unrelated?) JavaScript, rather then attempting these shenanigans. – CBroe Dec 07 '20 at 14:06
  • @CBroe I understand what you mean, but your answer doesn't help and it's not mischief either because I like to learn more about these things. Thanks for your "help". – Danii R Dec 07 '20 at 14:18
  • Okay chill, nobody here can guess whether you are deliberately going for a sub-optimal workaround, or trying to learn more about blogger syntax :-) You are trying to replace an attribute value here - that basically needs the `expr:` syntax. Not sure though whether you can use this to replace only _part of_ the attribute value with a placeholder. If not, then you might need to use a more complex `` construct. https://support.google.com/blogger/answer/46995 – CBroe Dec 07 '20 at 14:32
  • @CBroe I understand, it makes sense what you are saying and thanks to you I now have a clue that can help me a lot to implement a small custom code.Thank you for the tip. :) – Danii R Dec 07 '20 at 16:14
  • @CBroe I want to tell you that your data helped me a lot and I was able to implement a custom code for my template. Thanks for your help. – Danii R Dec 07 '20 at 18:37

0 Answers0