简体   繁体   English

HTML中尖括号内的字符串串联

[英]String concatenation inside angular brackets in HTML

How do I concatenate strings inside jinja brackets {{ }} in HTML? 如何在HTML的Jinja方括号{{}}中连接字符串?

Ex: <img src="{{ image.file.name }}"> 例如: <img src="{{ image.file.name }}">

I need to concatenate with the image.file.name. 我需要与image.file.name连接。

ex: <img src="{{ 'https://s3.ap-south-1.amazonaws.com/bucket_name/images/' + image.file.name }}"> 例如: <img src="{{ 'https://s3.ap-south-1.amazonaws.com/bucket_name/images/' + image.file.name }}">

But his didn't work. 但是他没有用。 Please help. 请帮忙。

you should write like this 你应该这样写

<img src="https://s3.ap-south-1.amazonaws.com/bucket_name/images/{{ image.file.name }}">

in jija you don't have to concat with + it will replace {{}} without it 在jija中,您不必与+并置,如果没有它,它将代替{{}}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM