Join subtemplates

Often we need to join some subtemplates in one html code with some clue. E.g. list of categories under thumb, related galleries list under video etc

Use this command for join

<?=Inxy::join($items$template$clue[, $name 'item'])?>
  • $items - array of objects to join (tags, categories, thumbs etc)
  • $template - subtemplate name for join
  • $separator - clue string
  • $name - name of object in subtemplate (not mandatory)

This command can be used anywere including subtemplate

Examples

Output thumb's tags

Main template:

<?=Inxy::join($thumb->tags'tags_no_ref'',')?>

sub/tags_no_ref.php:


<a href='<?=Inxy::url()->toTag($item)?>'><?=$item?></a>

Related galleries

Main template:

<?=Inxy::join($gal->related(10), 'related''')?>

sub/related.php:


<div class='thumb'>
<a target="_blank" title="<?=$item->title?>" href="<?=$item->gallery_url?>">
<img alt="<?=$item->title?>" src="<?=$item->media_url?>" />
</a>
<span>Added:</span><?=$item->publish_dt?><br/>
</div>