Вывод поля “ссылка на дерево” в UMI для PHP шаблонизатора

15.06.2019
$settingsContainer = $this->getSettingsContainer();
$top_categories = $settingsContainer->getValue('top_categories');

<ul class="slides">
   <?php if(is_array($top_categories)):
	  foreach($top_categories as $item):
		 $hierarchy = umiHierarchy::getInstance();
		 $page = $hierarchy->getElement($item->id);
		 $name = $item->getName();
		 $img = $page->getValue('header_pic');
		 $link = $hierarchy->getPathById($item->id);?>
		 <li>
			<a href="<?php echo $link;?>"><img src="<?php echo $img;?>" alt="<?php echo $name;?>"/>
			   <span><span><?php echo $name;?></span></span></a>
		 </li>
		   <?php endforeach;?>
		  <?php endif;?>
</ul>

Comments 0

Добавить комментарий

Your email address will not be published. Required fields are marked *