示例#1
0
<?php

$settings = \Blog\Models\Settings::fetch();
$safemode_enabled = \Base::instance()->get('safemode.enabled');
$safemode_user = \Base::instance()->get('safemode.username');
$display_author = !($safemode_enabled && $safemode_user == $item->{'author.username'});
$aside = false;
// are there tags?  // are there categories? // TODO: is a module published in the blog-post-aside position?
if ($tags = \Blog\Models\Posts::distinctTags() || ($cats = \Blog\Models\Categories::find() || $item->{'shop.products'})) {
    $aside = true;
}
$settings_admin = \Admin\Models\Settings::fetch();
$is_kissmetrics = $settings_admin->enabledIntegration('kissmetrics');
?>

<div class="blog-post">
    <div class="container">
        <div class="row">
            <div class="col-sm-<?php 
echo !empty($aside) ? '9' : '12';
?>
">
                <article class="blog-article">
                    <h1><?php 
echo $item->{'title'};
?>
</h1>
                    
                    <hr/>
                    
                    <p class="byline">
示例#2
0
<?php

$aside = false;
// are there tags?  // are there categories? // TODO: is a module published in the blog-author-aside position?
if ($tags = \Blog\Models\Posts::distinctTags() || ($cats = \Blog\Models\Categories::find())) {
    $aside = true;
}
?>

<div id="blog-author" class="blog-posts">
    <div class="container">    
        <div class="row">
            <div class="col-sm-<?php 
echo !empty($aside) ? '9' : '12';
?>
">    
            
            <?php 
$this->paginated = $paginated;
echo $this->renderView('Blog/Site/Views::posts/index.php');
?>
            
            </div>
            
            <?php 
if (!empty($aside)) {
    ?>
            <aside class="col-sm-3">
                <div class="widget">
                    <div class="widget-title">
                        <h2><?php 
示例#3
0
<?php

if ($cats = \Blog\Models\Categories::find()) {
    ?>
<div class="widget widget-categories">
	<h4 class="widget-title">Categories</h4>
	<div class="widget-content">
	
    <?php 
    foreach ($cats as $cat) {
        // TODO Set the classes based on anything in the $cat object and also on the active URL and also on $this->selected
        $classes = null;
        ?>
		<div>
    		<a href="./blog/category<?php 
        echo $cat->{"path"};
        ?>
" class="<?php 
        echo $classes;
        ?>
"><?php 
        echo $cat->{'title'};
        ?>
</a>
		</div>
    <?php 
    }
    ?>
	
	
	</div>