Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-feed-1.1.js

Код файла
Версия от 18.08.2026, 07:00:17 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1301	}1302}1303 1304function t_feed_drawImageInRowBig(opts, post, position, recid) {1305	var imageUrl = post.thumb ? post.thumb : post.image;1306	var height = opts.imageRatio + '%';1307	var str = '';1308	if ((post.thumb !== '' || post.image !== '' || post.mediatype === 'video') && opts.showImage) {1309		var altText = '';1310		if (post.thumb !== '' && post.thumbalt !== '') {1311			altText = post.thumbalt;1312
История файла и сравнение версий
  • 18.08.2026, 07:00:17 · 56c3b845
} else if (post.thumb === '' && post.image !== '' && post.imagealt !== '') {
1313 altText = post.imagealt;
1314 }
1315 var alt = altText ? `role="img" aria-label="${altText}"` : '';
1316
1317 str +=
1318 '<div class="t-feed__post-imgwrapper t-feed__post-imgwrapper_' +
1319 position +
1320 '" style="padding-bottom:' +
1321 height +
1322 ';">';
1323 if ((opts.showDate && opts.datePos == 'onimage') || (opts.showParts && opts.partsPos == 'onimage')) {
1324 str += '' + t_feed_drawDateAndParts(opts, post, 'onimage', 'col', recid);
1325 }
1326 str += `<div
1327 class="t-feed__post-bgimg t-bgimg"
1328 data-original="${imageUrl}"
1329 ${alt}
1330 style="background-image:url(${t_feed_getLazyUrl(opts, imageUrl)});"
1331 >${post.thumb ? `<meta itemprop="image" content="${imageUrl}"></meta>` : ''}${post.thumbalt ? `<meta itemprop="caption" content="${altText}"></meta>` : ''}</div>
1332 </div>`;
1333 }
1334 return str;
1335}
1336
1337function t_feed_drawImage(opts, post, position, recid, isBgModification) {
1338 var borderRadiusStyle;
1339 var aspectRatioStyle = 'aspect-ratio: ' + (opts.imageRatio ? 100 / opts.imageRatio : 100 / 66).toFixed(1) + ';';
1340
1341 if (isBgModification && opts.colWithBg.borderRadius) {
1342 if (position == 'afterdescr') {
1343 borderRadiusStyle =
1344 'border-radius: 0 0 ' + opts.colWithBg.borderRadius + ' ' + opts.colWithBg.borderRadius + ';';
1345 } else {
1346 borderRadiusStyle =
1347 'border-radius:' + opts.colWithBg.borderRadius + ' ' + opts.colWithBg.borderRadius + ' 0 0;';
1348 }
1349 } else {
1350 borderRadiusStyle = '';
1351 }
1352
1353 var imageStyle = 'style="' + aspectRatioStyle + borderRadiusStyle + '"';
1354 var mobileClass =
1355 opts.isHorizOnMob && opts.hasOriginalAspectRatio ? 't-feed__post-imgwrapper_mobile-nopadding' : '';
1356
1357 var str = '';
1358 if ((post.thumb !== '' || post.image !== '' || post.mediatype === 'video') && opts.showImage) {
1359 var imageUrl = (post.thumb ? post.thumb : post.image) || '';
1360
1361 var altText = '';
1362 if (post.thumb !== '' && post.thumbalt !== '') {
1363 altText = post.thumbalt;
1364 } else if (post.thumb === '' && post.image !== '' && post.imagealt !== '') {
1365 altText = post.imagealt;
1366 }
1367 var altAria = altText ? `role="img" aria-label="${altText}"` : '';
1368
1369 if (post.mediatype === 'video' && post.image === '' && post.thumb === '') {
1370 imageUrl =
1371 'https://static.tildacdn.' +
1372 t_feed__getRootZone() +
1373 '/ffb6456b-781b-40e8-9517-ffb5225e8bcd/imgfish.jpg';
1374 }
1375
1376 str +=
1377 '<div class="t-feed__post-imgwrapper t-feed__post-imgwrapper_' +
1378 position +
1379 ' ' +
1380 mobileClass +
1381 '" ' +
1382 imageStyle +
1383 '>';
1384
1385 if ((opts.showDate && opts.datePos == 'onimage') || (opts.showParts && opts.partsPos == 'onimage')) {
1386 str += '' + t_feed_drawDateAndParts(opts, post, 'onimage', 'col', recid);
1387 }
1388
1389 if (opts.hasOriginalAspectRatio) {
1390 str +=
1391 '<img ' +
1392 t_feed_getLazySrc(opts, imageUrl) +
1393 ' class="t-feed__post-img t-img js-feed-img" ' +
1394 ' alt="' +
1395 altText +
1396 '">';
1397 } else {
1398 str += `<div class="t-feed__post-bgimg t-bgimg" ${altAria} data-original="${imageUrl}" style="background-image:url(${t_feed_getLazyUrl(opts, imageUrl)});${borderRadiusStyle}">${post.thumb ? `<meta itemprop="image" content="${imageUrl}"></meta>` : ''}${post.thumbalt ? `<meta itemprop="caption" content="${altText}"></meta>` : ''}</div>`;
1399 }
1400 str += '</div>';
Предыдущие 100 строкСледующие 100 строк