Created
December 24, 2019 03:28
-
-
Save OlegShchavelev/29f7a901aea6786064db0c1812ceaa84 to your computer and use it in GitHub Desktop.
Работаем с SeoFilter2
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 | |
$pdo = $modx->getService('pdoFetch'); | |
$modx->addPackage('seofilter', $modx->getOption('core_path') . 'components/seofilter/model/'); | |
$id = $modx->resource->id; | |
$seo_id = $modx->getPlaceholder('sf.seo_id'); | |
$tpl = '@INLINE <div class="filter_item filter_logo_item"> | |
<p><img src="{$logo}" alt="" /><span>{$name}</span></p> | |
</div>'; | |
if ($seo_id != '') { | |
$seo_page = $modx->getObject('sfUrls', [ | |
'id' => $seo_id | |
]); | |
$seo_link = $seo_page->get('link'); | |
$rows = $pdo->getCollection('msVendor', [ | |
'name' => $seo_link | |
]); | |
} | |
else{ | |
$rows = $pdo->getCollection('msVendor', [ | |
'resource' => $id | |
]); | |
} | |
$output = ''; | |
foreach ($rows as $row) { | |
$output .= $pdo->getChunk($tpl, $row); | |
} | |
return $output; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment