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.

Support

Pages from taxonomy

first-time

Started by Marco 3 years ago · 4 replies · 491 views
3 years ago

I'm a new user with no programming experience and I'm considering GRAV to build my own website.

My goal is to collect in one place notes and diaries of my travels and personal events.

I am using:

  • the Quark theme.
  • the admin plugin

I have read the documentation on the site

In Site > Taxonomy Types I have set:

  • category
  • tag
  • location
  • event

I set up directories (Pages) like this:

TXT
/blog
../2023
..blog.md
..../2023-01-07
....item.md
..../2023-07-23
....item.md
..../2023-07-29
....blog.it.md
....../2023-07-29
.......item.md
....../2023-07-30
.......item.md
......./2023-07-31
.......item.md
......./2023-08-01
.......item.md

/location
../Italy
....default.md
..../Gorizia
....default.md
..../Torino
....default.md

In the "item.md" I've filled the taxonomies with the appropriate value e.d.:

......./2023-07-31
.......item.md
has:

YAML
category: trip
tag: trip, camper
location: Italy, Gorizia
event: Summer 2023 trip

......./2023-08-01
.......item.md
has:

YAML
category: trip
tag: trip, camper
location: Italy, Gorizia
event: Summer 2023 trip

To which type and how should I set:

..../Torino
....default.md

to be able to filter/search for pages that have the taxonomy location: Turin

I used advanced mode to enter:

YAML
content:
  items:
    '@page.descendants': '/blog'
    '@taxonomy':
      location: Torino

but without results.

Thanks for your advice.

Marco.

last edited 08/24/23 by Marco
3 years ago

@Marco10x15,

A few notes...

  • filtering
    • I guess you will probably be using plugin TaxonomyList to filter the items in the collection. Please know that TaxonomyList will only filter on a single taxon. Either category, tag, location, or event, but not combinations.
    • If an item.md contains multiple tags, or locations, they must be surrounded by brackets, like location: [Italy, Gorizia].
  • folder structure
    • Any particular reason why you are separating your files in two folders /blog and /location
    • Any particular reason why you are using template 'default' for pages in folder /locations?

To which type and how should I set:

  • What do you mean with "type"
  • "how should I set" what?

What have you tried?

but without results.

I presume, you mean you did not get the results you expected.

  • What result did you expect.
  • What results did you get?
3 years ago

I have installed TaxonomyList

My goal is:

  • have in blog all the item.md with the taxonomy location
  • in the location structure the corresponding pages so that you can list the pages of the blog that refer to this place.

I thought of location to build a hierarchy like:

  • location\Europe\Italy\Gorizia
  • location\Europe\France\Paris
  • location\Europe\France\Paris\Louvre Museum
  • location\Europe\Hungary\Tsendre

In order to answer my curiosity: When I was in Paris? or in Tsendre?

Scrolling through the list of plug-ins I saw that there is a leaflet plug-in so, in the future, I thought of inserting in the page "Paris", "Tsendre" also the map in the to place page.

Paris I remember where it is but for smaller cities and villages like Tsendre I am happy to place them on a map to locate them.

By type I mean:

  • choosing for the page Gorizia between "Blog", "Item" or other.

I tried using "Blog", expecting the "Item" items in blog to be listed under the page \location\Italy\Gorizia but it didn't happen.

3 years ago

@Marco10x15, I'm afraid I still do not get the picture... Hopefully someone else in the community can help you.

3 years ago

I figured this.

Create a page "Gorizia" with:

YAML
---
title: Gorizia
content:
    items:
        '@taxonomy.luogo': Gorizia
    order:
        by: date
        dir: desc
---

that work fine, I have all the page that are related to "Gorizia"

Now is possible to use the page title to fill the @taxonomy.luogo?

This will escape a lot of work rewriting for every page with the correct location name.

Something like:

YAML
---
title: Gorizia
content:
    items:
        '@taxonomy.luogo': '@Self.title'
    order:
        by: date
        dir: desc
---

that I know is non correct
Thank

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 66 18 hours ago
Support · by Anna, 3 days ago
2 72 21 hours ago
Support · by Justin Young, 22 hours ago
1 40 21 hours ago
Support · by Duc , 1 week ago
2 76 6 days ago
Support · by Colin Hume, 1 week ago
2 70 6 days ago