Code Monkey home page Code Monkey logo

Comments (4)

S1SYPHOS avatar S1SYPHOS commented on June 14, 2024

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.

demlak avatar demlak commented on June 14, 2024

When there are no categories declared, the section is still in the ui.
for example:

lbc

from kirby-lingonberry.

S1SYPHOS avatar S1SYPHOS commented on June 14, 2024

As I said, just replace it with something else, like the widget saying 'About Zero Mental alignment' for example?

from kirby-lingonberry.

demlak avatar demlak commented on June 14, 2024

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> &copy; <?= 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() . ' &mdash;') ?> <a title="To the Top" class="tothetop">Up &uarr;</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.

#18

from kirby-lingonberry.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.