Sorry I didn't provide the complete file. I have "@{}" around the whole code and since the that line is with in the foreach loop it didn't need the @ infront of it. It is currently working.
In v7.2.8 I was able to write out a line like this and it worked:
Razor html attribute assignment in Umbraco v7.3.4
In Umbraco v7.2.8 I was able to use the following code without problems:
which creates an href value of something like tel:15554443333
In Umbraco v7.3.4 this creates an href value of something like tel:[email protected]
To fix this I had to change to code to look like this:
The href value of the anchor tag around the image still works though.
Is this the new way to do it, or is there a better way to assign the attributes of html elements in Razor?
Hi Ben
should also work
ie performing the concatenation inside the @() syntax
It's breaking in your example because the @myPerson.phoneExtension is in the middle of the attribute and razor is not parsing it...
regards
marc
Hi Ben, Marc
Just noticed something . .
In front of the tel: it is not a ".
Maybe it will work if you amend this.
Shouldn't be any changes between 7.2.8 and current, that is what made me look closer.
Regards
Gary
Hi Gary,
Sorry I didn't provide the complete file. I have "@{}" around the whole code and since the that line is with in the foreach loop it didn't need the @ infront of it. It is currently working.
In v7.2.8 I was able to write out a line like this and it worked:
Something seems to have changed between v7.3.0 and v7.3.4.
I will try the following when I get a chance:
Thanks for your help Marc and Gary! I really appreciate it!
is working on a reply...