This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//OnDocFormSave | |
$img_path = $modx->getOption('imagesPath',$scriptProperties, MODX_ASSETS_URL."static/images/"); | |
$imgName = $modx->getOption('ImageName',$scriptProperties,'default.png'); | |
$TvValue = $modx->getOption('TV',$scriptProperties,'firstImage'); | |
$def_img = $img_path.$imgName; | |
$img = $resource->GetTVValue($TvValue); | |
$text = $resource->content; | |
if(empty($img)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Краткий справочник по SCSS*/ | |
/* 1. --------------------------------------------------------------------------- | |
Sass позволяет вкладывать правила CSS друг в друга. | |
Вложенные правила применяются только для элементов, соответствующих внешним селекторам.*/ | |
#main p { | |
color: #00ff00; | |
width: 97%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flex-wrap: nowrap; | |
/* |---------------------------| | |
|#### #### #### #### #### #### #### | |
|#### #### #### #### #### #### #### | |
|#### #### #### #### #### #### #### | |
|---------------------------| | |
*/ | |
flex-wrap: wrap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loadedMetrica = false; | |
window.addEventListener('scroll', loadMetrica); | |
window.addEventListener('click', loadMetrica); | |
window.addEventListener('mousemove', loadMetrica); | |
function loadMetrica() { | |
if (!loadedMetrica) { | |
setTimeout(function() { | |
/* ТУТ ВАШ КОД И СКРИПТЫ, метрика например*/ | |
},500); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<picture> | |
<source type="image/webp" media="(min-width: 1921px)" srcset="src/images/very-large/bike.webp"> | |
<source type="image/png" media="(min-width: 1921px)" srcset="src/images/very-large/bike.png"> | |
<source type="image/webp" media="(min-width: 1281px) and (max-width: 1920px)" srcset="src/images/regular/bike-regular.webp"> | |
<source type="image/png" media="(min-width: 1281px) and (max-width: 1920px)" srcset="src/images/regular/bike-regular.png"> | |
<source type="image/webp" | |
media="(min-width: 461px) and (max-width: 1280px) and (orientation: landscape)" | |
srcset="src/images/tablet-landscape/bike-tablet-landscape.webp"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="http://youtu.be/[[getPlaceholder? &id=`[[+parent]]` &placeholder=`tv.video`]]" target="_blank"> | |
<img src="[[!pthumb? &input=`http://img.youtube.com/vi/[[getPlaceholder? &id=`[[+parent]]` &placeholder=`tv.video`]]/0.jpg` &options=`&w=480&h=270&zc=1`]]"> | |
</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//chunk youtube-video-tpl | |
<div class="col-1-3"> | |
<a class="mediabox" rel="ytv" href="http://www.youtube.com/embed/[[+id]]"> | |
<img src="[[+thumb]]" alt=""> | |
<h3>[[+title]]</h3> | |
</a> | |
</div> | |
//Snippet | |
<?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* lastModified | |
* | |
* Copyright 2016 by demon.devin <demon.devin@gmail.com> | |
* Created on 10-07-2016 | |
* | |
* lastModified is free software; you can redistribute it and/or modify it under the | |
* terms of the GNU General Public License as published by the Free Software | |
* Foundation; either version 2 of the License, or (at your option) any later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Получение любого поля ресурса произвольного ресурса | |
{1 | resource : 'pagetitle'} | |
// Текущий год | |
{'' | date : 'Y'} | |
//Условие IF | |
{$id == '1' ? '' : $url} | |
//Получение изображения через переменную с точкой ($_pls) |
OlderNewer