Giter Club home page Giter Club logo

tagcloud-plugin's Introduction

Tagcloud Plugin

What is it?

The tagcloud plugin will fetch all tags (comma separated) from a page's subpages, and return them with additional information - like the number of subpages for each tag.

Installation

Put the tagcloud folder into /site/plugins.

How to use it?

Content files

To add tags to your content files, put them in a tags field, using the default comma as the separator:

Title: Some Title
----
Text: Some Text
----
Tags: design, fun, photography
----

In your template add i.e.:

  <?php $tagcloud = tagcloud(page('blog'), array('limit' => 20)) ?>

	<ul>
	<?php foreach($tagcloud as $tag): ?>
	  <li><a href="<?php echo $tag->url() ?>"><?php echo $tag->name() ?></a></li>
	<?php endforeach ?>
	</ul>

As the first argument you should pass the main page. All children of that page will be searched to find all the tags. So, if you have a 'blog' page that has 'article' pages as children, and you want to find all the tags in your articles, you'd pass the parent blog page as the first argument.

Available options

limit

The number of tags in your tagcloud. If not specified, all tags will be returned.

field

The name of the Tags field in your content files. By default this is "tags"

children

Which children of the given page should be searched? Possible values are "all", "visible", "invisible". Default is "visible"

baseurl

The base URL, which will be used to build tag URLs. By default the URL of the given page.

param

The name of the param, which will be used for the URL. By default this is just "tag". So the default URL will be "http://yourdomain.com/given-page/tag:design" for example

sort

The field to sort by. By default the tagcloud will be sorted by the number of results per tag, but you can also sort it by tag name for example.

sortdir

The sort direction. Can be "desc" or "asc". Default is "desc"

Author

Bastian Allgeier http://getkirby.com

tagcloud-plugin's People

Contributors

bastianallgeier avatar texnixe avatar luxlogica avatar

Watchers

Randy avatar

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.