0
Welcome Guest! Login
0 items Join Now

Blog menu displaying tags instead of post titles

    • beamaria's Avatar
    • beamaria
    • Hero Rocketeer
    • Posts: 287
    • Thanks: 3

    Blog menu displaying tags instead of post titles

    Posted 2 months 4 weeks ago
    • Hi all!
      As from the title: is it possible to achieve this? At present my blog menu opens a submenu where the items are the various posts. Let’s say that three posts has “tag 1” and other three have “tag 2” . I wonder if I can have the tag 1 and tag 2 in the submenu, so when I click on “tag 1” I go to a page listing all the posts tagged as “tag 1” and so on…
      I think I can achieve this with page collections, I have read the related documentation, but I couldn’t find a clear solution to my problem (only a newbie and get confused about the correct setting of frontmatter)
      Using Gantry 5+ Helium Theme + GRAV
      Thanks in advance for any help!
    • Last Edit: 2 months 4 weeks ago by beamaria.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 89700
    • Thanks: 11707
    • Web Designer/Developer

    Re: Blog menu displaying tags instead of post titles

    Posted 2 months 3 weeks ago
    • Yes. if you have create a submenu then you just create a page within (type "blog list") and use a taxonomy collection with (for example)
      '@taxonomy.tag': tag1

      On the items in the blog list page settings.

      https://learn.getgrav.org/16/content/collections

      Regards, Mark.
    • Last Edit: 2 months 3 weeks ago by MrT.
    • The following users have thanked you: beamaria

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • beamaria's Avatar
    • beamaria
    • Hero Rocketeer
    • Posts: 287
    • Thanks: 3

    Re: Blog menu displaying tags instead of post titles

    Posted 2 months 3 weeks ago
    • Thanks Mark!
      I'm still in my learning curve for GRAV. It's not clear to me if categories and tags are on the same level or -like in joomla - categories are a level above the tags...
      At present I have a main menu item called "News" and two submenu of it: "Blog" and "Features"
      "News" is set as a blog-list (non routable) with multiple collections in the page:
      -
        '@taxonomy.category': blog
      -
        '@taxonomy.category': features

      Both "Blog" and "Features" are set as blog-list with this code:
      - '@self.children'

      Everything is working properly, from "Archives" to "Related pages" plugin, but when it comes to "Taxonomy list" all the tags are mixed, irrespectively if they belong to posts in "Blog" or "Features" category...
    • Last Edit: 2 months 3 weeks ago by beamaria.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 89700
    • Thanks: 11707
    • Web Designer/Developer

    Re: Blog menu displaying tags instead of post titles

    Posted 2 months 3 weeks ago
    • They will be because you stated to list items from two categories. Try what I stated:

      Create a new "page" of type "blog list" and call it "tag1". Then add the taxonomy of "tag1" like I showed above that will list all items that are tagged "tag1" regardless of category. If you want to restrict that to certain categories too then you can add that in the category selection.

      Think of "taxonomy" as "collection" - "category" and "tag" are two sorts of taxonomy - as they're the common ones most people what we make it a little easier to use them "out of the box" but your can have other taxonomy too. The taxonomy are independent of each other (and incidentally that's how they are in Joomla too) - one is not a child of the other at all.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • beamaria's Avatar
    • beamaria
    • Hero Rocketeer
    • Posts: 287
    • Thanks: 3

    Re: Blog menu displaying tags instead of post titles

    Posted 2 months 3 weeks ago
    • Will do! and then let you know if I succeed ;-)
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 89700
    • Thanks: 11707
    • Web Designer/Developer

    Re: Blog menu displaying tags instead of post titles

    Posted 2 months 3 weeks ago
    • Yes, let us know the outcome.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • beamaria's Avatar
    • beamaria
    • Hero Rocketeer
    • Posts: 287
    • Thanks: 3

    Re: Blog menu displaying tags instead of post titles

    Posted 2 months 3 weeks ago
    • Ok, I followed your instructions, but now I have a problem with the "Archives" plugin, which has only a "category filter", not a tag filter...as a result, having left empty the category field in posts, now no archives are displayed...
      Basically my solution:
      At present I have a main menu item called "News" and two submenu of it: "Blog" and "Features"
      "News" is set as a blog-list (non routable) with multiple collections in the page:
      -
        '@taxonomy.category': blog
      -
        '@taxonomy.category': features

      Both "Blog" and "Features" are set as blog-list with this code:
      - '@self.children'

      was ok and working, but for the Taxonomy list, which was messed up.
      I tried to write this code in my custom HTML particle of helium template:

      {% include 'partials/taxonomylist.html.twig' with {base_url: my_url, taxonomy: 'tag', children_only: true} %}

      but there is something wrong in the URL, beacuse the tag links displayed go to a 404 "not found" page.
      For instance when I click on the tag link "landscape" I have th 404 error and the link is
      http://localhost:8888/tag:landscape
      instead of
      http://localhost:8888/gravsite/news/blog/tag:landscape

      It looks like the URL doesn't see the /news/blog/ section (where news is the mainmenu item and blog its submenu)
    • Last Edit: 2 months 3 weeks ago by beamaria.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 89700
    • Thanks: 11707
    • Web Designer/Developer

    Re: Blog menu displaying tags instead of post titles

    Posted 2 months 3 weeks ago
    • I'd need to see your site to comment any further. Please would you post your URL, admin id and pswd in the secure tab of your post and I'll have a look for you.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
    • beamaria's Avatar
    • beamaria
    • Hero Rocketeer
    • Posts: 287
    • Thanks: 3

    Re: Blog menu displaying tags instead of post titles

    Posted 2 months 3 weeks ago
    • Hi Mark! i need to put the website online and then I'll let you have the required credentials.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 89700
    • Thanks: 11707
    • Web Designer/Developer

    Re: Blog menu displaying tags instead of post titles

    Posted 2 months 3 weeks ago
    • ok, just reply when I can look.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.

Time to create page: 0.088 seconds