Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

How does the "author" feature works?

Started by Muut Archive 12 years ago · 3 replies · 324 views
12 years ago

I saw there is an author folder in the antimatter theme. But I can't figure out if a template is missing or not... I found correct information about how to filter using the taxonomy, but I do not have any idea of why this author folder does exist, and how I could use it.

Do you have any clue?

12 years ago

Ah, that author folder should of been removed. It was part of an early iteration of the blog where I was including the content of this invisible and unroutable author page into the sidebar. That was being done with something like:

TWIG
{% set author = taxonomy.findTaxonomy({'author':'andym'})|first %}

<div class="author">
    <img src="{{ (author.assets.images|first).url }}" />
    <h3>{{ author.header.name }}</h3>
    <h5>{{ author.header.email|safe_email }}</h5>
    <p>{{ author.content }}</p>
</div>

FYI, you also need to add author to the list of taxonomy entries in your /user/config/site.yaml in order for Grav to be able to use it.

Note: this is untested but should give you a general idea.

12 years ago

Ok, thank you for this. Indeed, it does not behave as I would have expected.

12 years ago

Pages within in Grav or merely repositories for data. In most cases these map directly one-to-one with menu items enabling you to create a navigational hierarchy that becomes your site.

However, it is possible to use pages as pure data, so that you can organize them with taxonomy, and reference they later via the Taxonomy object. They can be configured so that they cannot be reached directly via a URL nor visible in a menu. This is what I was testing with the Author page.

As the author information needs to be provided by the author themselves, it didn't make sense including this in the demo content for the blog, so it was removed. However, it's still a useful and powerful feature that does have its uses.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1280 9 years ago
Archive · by Muut Archive, 9 years ago
2 888 9 years ago
Archive · by Muut Archive, 9 years ago
2 4016 9 years ago
Archive · by Muut Archive, 9 years ago
1 2892 9 years ago
Archive · by Muut Archive, 9 years ago
3 1076 9 years ago