HackerTrans
TopNewTrendsCommentsPastAskShowJobs

pedroborges

no profile record

comments

pedroborges
·9 tahun yang lalu·discuss
Kirby doesn't output any markup, you have total control to over it :D The API for querying content is very powerful.
pedroborges
·9 tahun yang lalu·discuss
You can do whatever you want on your templates. If by widget you mean reusable code, you could use a snippet.

So this logic can go on a template or snippet:

  <?php $latest = page('blog')->children()->visible()->limit(6); ?>

  <div class="widget">
  <?php foreach($latest as $post) : ?>
    <a href="<?= $post->url()?>"><h2><?= $post->title()->html() ?></h2></a>
  <?php endforeach ?>
  </div>
Instead of fetching the post on the template, you could use a controller and just pass the $latest variable to the template.
pedroborges
·9 tahun yang lalu·discuss
When you write a blog post, it creates a text file (metadata & content) in the /content folder, not an HTML file.

Take a look at the Starter Kit (it's the best way to try Kirby): https://github.com/getkirby/starterkit

Look inside the /content and /site/templates folders.
pedroborges
·9 tahun yang lalu·discuss
I'm a web developer who have been happily using Kirby for over a year. I'm available for answering question you might have about Kirby.

(I'm not affiliated with the Kirby team).