Comments (4)
The user is free not to use them, why make an option for this? Just replace / remove the parts related to categories / tags, and that's it.
I'm open to discussion, but I don't see a particular problem right now!
from kirby-lingonberry.
When there are no categories declared, the section is still in the ui.
for example:
from kirby-lingonberry.
As I said, just replace it with something else, like the widget saying 'About Zero Mental alignment' for example?
from kirby-lingonberry.
since the About-Widget is part of lingonberry, you say, i should edit source code?
there came an idea in my mind to have those tags and categories allways optional by setting an if-clause around those images.
(i realy should learn how to use git/github)
my suggestion for site/snippet/footer.php
(changes are commented):
</div><!-- .posts -->
</div><!-- .content section-inner -->
</div><!-- /content -->
<?php
$categories = page('home')->children()->visible()->pluck('category', ',', true);
$tags = page('home')->children()->visible()->pluck('tags', ',', true);
sort($tags);
?>
<div class="footer section">
<div class="footer-inner section-inner">
<div class="widgets">
<div class="widget">
<div class="widget-content">
<h3 class="widget-title">Recent Posts</h3>
<ul>
<?php foreach(page('home')->children()->visible()->flip()->limit(5) as $recent) : ?>
<li><a href="<?= $recent->url() ?>"><?= $recent->title()->html() ?></a></li>
<?php endforeach?>
</ul>
</div><!-- .widget-content -->
<div class="clear"></div>
</div><!-- .widget -->
<div class="clear"></div>
<?php if(empty($categories) or empty($tags)): ?> <!-- if categories or tags are empty, move widget -->
</div><!-- .widgets -->
<div class="widgets">
<?php endif ?>
<div class="widget">
<div class="widget-content">
<h3 class="widget-title">About <?= $site->title()->html() ?></h3>
<?= $site->description()->kt() ?>
</div><!-- .widget-content -->
<div class="clear"></div>
</div><!-- .widget -->
<div class="clear"></div>
</div><!-- .widgets -->
<?php if(!empty($categories)): ?> <!-- if categories are empty, don't display widget -->
<div class="widgets">
<div class="widget">
<div class="widget-content">
<h3 class="widget-title">Categories</h3>
<ul>
<?php foreach($categories as $category) : ?>
<?php $categoryURL = url('home') . '/category:' . urlencode($category); ?>
<li><a href="<?= $categoryURL ?>"><?= $category ?></a></li>
<?php endforeach?>
</ul>
</div><!-- .widget-content -->
<div class="clear"></div>
</div><!-- .widget -->
<div class="clear"></div>
</div><!-- .widgets -->
<?php endif ?> <!-- end of widget empty-check -->
<?php if(!empty($tags)): ?> <!-- if tags are empty, don't display widget -->
<div class="widgets">
<div class="widget widget_tag_cloud">
<div class="widget-content">
<h3 class="widget-title">Tagcloud</h3>
<div class="tagcloud">
<?php foreach($tags as $tag) : ?>
<?php $tagURL = url('home') . '/tag:' . urlencode($tag); ?>
<a href="<?= $tagURL ?>"><?= $tag ?></a>
<?php endforeach?>
</div>
</div><!-- .widget-content -->
<div class="clear"></div>
</div><!-- .widget -->
<div class="clear"></div>
</div><!-- .widgets -->
<?php endif ?> <!-- end of widget empty-check -->
<div class="clear"></div>
</div><!-- .footer-inner -->
</div><!-- .footer -->
<div class="credits section">
<div class="credits-inner section-inner">
<p class="credits-left">
<span>Copyright</span> © <?= date('Y') ?> <a href="<?= $site->url() ?>" title="<?= $site->title()->html() ?>"><?= $site->title()->html() ?></a>
</p>
<p class="credits-right">
<?php e($site->footer()->isNotEmpty(), $site->footer()->ktRaw() . ' —') ?> <a title="To the Top" class="tothetop">Up ↑</a>
</p>
<div class="clear"></div>
</div><!-- .credits-inner -->
</div><!-- .credits -->
<!-- JS -->
<?= js(array(
'assets/jquery.js',
'assets/jquery-migrate.min.js',
'assets/flexslider.min.js',
'assets/global.js'
)) ?>
</body>
</html>
Empty Categories or Tagcloud will not be shown. Also if there is one of them empty, the About-widget moves position there.
from kirby-lingonberry.
Related Issues (18)
- Some initial issues HOT 2
- Alt attribute handling HOT 1
- Making Gravatar support optional HOT 3
- Suggestions HOT 2
- no blog entries - error with site/templates/home.php? HOT 3
- opengraph with lingonberry - 'kirby-meta-tags'-example-config HOT 3
- RSS-Feed does not Include Intro - fix inside HOT 1
- Call to a member function firstName() on null HOT 1
- table alignment - unwanted behavior HOT 1
- line spacing on image alignment HOT 2
- Table issue
- showing excerpt instead of full post
- Adding comment count & anchor link to `meta.php`
- Writing docs for available theme options
- Global (shared) controller?
- coverimage() for pages
- missing /assets/images/2x/post-formats/image.png HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kirby-lingonberry.