GithubHelp home page GithubHelp logo

Comments (4)

atomicbird avatar atomicbird commented on June 12, 2024

One possible fix is to change blog.php, replacing this:

<a class="category" href="<?php echo url() ?>blog/category:<?php echo $article->categories(); ?>"><?php echo $article->categories(); ?></a>

With this:

<?php
    foreach(explode(",", $article->categories()) as $category) {
        echo '<a class="category" href="' . url() . 'blog/category:' . $category . '">' . $category . '</a> ';
    }       
?>

This has the effect of creating multiple links that each link to a single category, instead of a single category link that includes all categories in the article-- which seems like the result I'd want. It's probably obvious that PHP is not my strongest language though, so I'd appreciate any improvements anyone could suggest.

from baseblog.

sashtown avatar sashtown commented on June 12, 2024

The current version of the theme isn't able to list and link multiple categories. That's right. (And no: The home page is set to blog as you can see in the config.)

In my opinion it's not really necessary to choose more than one category for a blog post (in the very most cases). Of course this depends on the general organisation of a blog and its categories. For multiple specification of posts I'd recommend tags. To implement these check out the tagcloud plugin.

The theme was made just to give users a clean start when creating a blog with Kirby und let them customize it for their own needs. So if you wanna add the ability to use multiple categories, feel free to fork the theme and extend it by building some fancy stuff!

from baseblog.

atomicbird avatar atomicbird commented on June 12, 2024

I can see that the home page is set to blog there, but I wasn't sure if it was the same on the demo site at http://baseblog.sashtown.de/. Anyway, if multiple categories aren't supported then I suggest that "categories" should be changed to "category" in the sample content, the docs, and wherever else it needs to change. When the sample content contains lines like

Categories: Tools

...the plural "Categories" suggests pretty strongly that more than one can be used.

from baseblog.

sashtown avatar sashtown commented on June 12, 2024

You're absolutely right, Tom. Using the plural was my way to stick to the code example which has been described in the tagcloud article over a year ago (even if I didn't want to implement tags). BTW: I'm not that PHP nerd, too... :)

After your last comments I reconsidered that whole category stuff and I decided to bring up the possibility to use multiple categories as well! It really is the way better approach for a good start especially for folks who aren't that familiar with Kirby yet.

My latest commit comes up with an update which includes multiple categories and no categories as well.
Hope you like it.

from baseblog.

Related Issues (5)

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.