Created
February 14, 2017 17:32
-
-
Save pakimov/91b96e3ea2619b6bc18e654452eb9f57 to your computer and use it in GitHub Desktop.
This file contains 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
Всем привет! Помогите пожалуйста со следующим вопросом. | |
Нужно получить значение tv родителя (tv.image) и обрезать его при помощи phpthumbon. | |
Использую шаблонизатор Fenom | |
ТВ можно получить следующим образом: | |
{$_modx->runSnippet("pdoField", [ | |
"id" => "{$id}", | |
"field" => "image", | |
"top" => 1 | |
])}Обрезка изображения(tv.image) следующим образом: | |
<img src="{$_modx->runSnippet("phpthumbon", [ | |
"options" => "&w=250&h=160&zc=1", | |
"input" => $_pls["tv.image"] | |
])}">как их совместить между собой? | |
Код вывода ресурсов | |
<div class="news"> | |
<div class="news__box"> | |
{$_modx->runSnippet('pdoPage', [ | |
'fenomModifiers'=>'dateAgo', | |
'element'=>'pdoResources' | |
'depth' => 1, | |
'hideContainers'=>'1', | |
'limit' => 3, | |
'includeTVs' => 'image', | |
'includeContent' => '1', | |
'tpl' => '@INLINE | |
<div class="news__item news-item clear"> | |
<a href="{$_modx->makeUrl($id)}" class="news-item__img-link"> | |
<img src="{$_modx->runSnippet("pdoField", ["id" => "{$id}","field" => "image","top" => 1])}" alt="" class="news-item__img" width="210"> | |
<span class="news-item__date"><i class="icon icon-date"></i> {$publishedon | dateago}</span> | |
</a> | |
<div class="news-item__content"> | |
<h3 class="news-item__ttl h3"><a href="{$_modx->makeUrl($id)}" class="news-item__ttl-link"><span class="news-item__ttl-name">{$_modx->runSnippet("pdoField", ["id" => "{$id}","field" => "pagetitle","top" => 1])}</span>{$pagetitle}</a></h3> | |
<p class="news-item__intro">{$content|truncate:400:" ...":true:false}</p> | |
</div> | |
</div>', | |
])} | |
</div> | |
[[!+page.nav]] | |
</div>Как обрезать изображение ? | |
<img src="{$_modx->runSnippet("pdoField", ["id" => "{$id}","field" => "image","top" => 1])}" alt="" class="news-item__img" width="210"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment