Foren / National / Russian / Как везде добавить H1 и alt к картинкам ?

Kopusha
#44881 8. Juni 2020, 08:39
				<img alt="<!-- IF {FILES_ROW_TITLE} -->{FILES_ROW_TITLE}<!-- ELSE -->{PHP.item.item_title}<!-- ENDIF --><!-- IF {PHP.item.item_country} -->, {PHP.item.item_country|cot_getcountry($this)}<!-- ENDIF --><!-- IF {PHP.item.item_region} -->, {PHP.item.item_region|cot_getregion($this)}<!-- ENDIF --><!-- IF {PHP.item.item_city} -->, {PHP.item.item_city|cot_getcity($this)}<!-- ENDIF --> photo by {PHP.item.item_userid|get_user_userfullname()}<!-- IF {PHP.tag_keywords} -->, {PHP.tag_keywords}<!-- ENDIF -->" src="{FILES_ROW_ID|cot_files_thumb($this,700,'auto')}" class="img-fluid img-wave" id="{FILES_ROW_ID}">
				<!-- IF {FILES_ROW_TITLE} --><div class="_on-img-title<!-- IF {FILES_ROW_TITLE|mb_strlen($this)} > 30 --> fs-11<!-- ENDIF -->">{FILES_ROW_TITLE}</div><!-- ENDIF -->
				<meta itemprop="author" content="{PHP.item.item_userid|get_item_author($this)}">
				<meta itemprop="contentLocation" content="<!-- IF {PHP.item.item_country} -->{PHP.item.item_country|cot_getcountry($this)}<!-- ENDIF --><!-- IF {PHP.item.item_region} -->, {PHP.item.item_region|cot_getregion($this)}<!-- ENDIF --><!-- IF {PHP.item.item_city} -->, {PHP.item.item_city|cot_getcity($this)}<!-- ENDIF -->">
				<!-- IF {FILES_ROW_TITLE} -->
				<meta itemprop="name" content="{FILES_ROW_TITLE}">
				<!-- ELSE -->
				<meta itemprop="name" content="{PHP.item.item_title}">
				<!-- ENDIF -->
				<meta itemprop="description" content="<!-- IF {FILES_ROW_TITLE} -->{FILES_ROW_TITLE}<!-- ELSE -->{PHP.item.item_title}<!-- ENDIF --><!-- IF {PHP.item.item_country} -->, {PHP.item.item_country|cot_getcountry($this)}<!-- ENDIF --><!-- IF {PHP.item.item_region} -->, {PHP.item.item_region|cot_getregion($this)}<!-- ENDIF --><!-- IF {PHP.item.item_city} -->, {PHP.item.item_city|cot_getcity($this)}<!-- ENDIF --> photo by {PHP.item.item_userid|get_user_userfullname()}<!-- IF {PHP.tag_keywords} -->, {PHP.tag_keywords}<!-- ENDIF -->">

Как то так наверное)

Added 57 seconds later:

Кстати Гугл весьма неохотно ловит в поиск картинки меньше 698 пикселов по широкой, потому советую cot_files_thumb($this,700,'auto')

Added 1 minute later:

И что бы использовать верно itemprop надо обернуть в itemtype, как то так

<a itemscope itemtype="http://schema.org/ImageObject" data-fancybox="gallery" href="{FILES_ROW_URL}" title="<!-- IF {FILES_ROW_TITLE} -->{FILES_ROW_TITLE}<!-- ELSE -->{PHP.item.item_title}<!-- ENDIF --><!-- IF {PHP.item.item_country} -->, {PHP.item.item_country|cot_getcountry($this)}<!-- ENDIF --><!-- IF {PHP.item.item_region} -->, {PHP.item.item_region|cot_getregion($this)}<!-- ENDIF --><!-- IF {PHP.item.item_city} -->, {PHP.item.item_city|cot_getcity($this)}<!-- ENDIF --> photo by {PHP.item.item_userid|get_user_userfullname()}<!-- IF {PHP.tag_keywords} -->, {PHP.tag_keywords}<!-- ENDIF -->" rel="nofollow" data-caption="{FILES_ROW_TITLE}">