Sign in

Tags for “Tag_prefix” and “Author_prefix”

  • This topic has 10 replies, 3 voices, and was last updated 3 weeks, 2 days ago by .
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #7697
    shaun2k

    Hi,

    I’m trying to include the “tag-prefix” and “author-prefix” in my breadcrumbs menu but couldn’t find the appropriate tag to use.

    For example, URL for “widget1” is “domain/products/widget1”.

    On the tag.hbs page,  {{name}} returns “widget1” but how does one get “products”?

    Thanks.

     

    #7701
    Bob

    widget1 is a tag or a post name?

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #7754
    shaun2k

    widget1 is a tag or a post name?

    Hi Bob,

    In my example, widget1 is a tag.

    So, on the tag page for widget1, the desired breadcrumbs would be

    Home > Products > Widget1

    And if Post1 had widget1 as its main tag, the breadcrumbs would be

    Home > Products > Widget1 > Post1_title

    Thanks.

    #7756
    Bob

    Take a look at this topic: https://forum.getpublii.com/topic/breadcrumb-and-multilanguage/

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #7768
    shaun2k

    Take a look at this topic: https://forum.getpublii.com/topic/breadcrumb-and-multilanguage/

    Yes, I was following the method in that post and that worked well for the post pages.
    I also wanted to implement similar breadcrumbs for the tag pages, for example, https://example.com/TAG_PREFIX/tag-slug1, I would have liked the breadcrumbs to look like:
    Home > TAG_PREFIX > tag_name1

    Then on the tags page,
    Home > TAG_PREFIX

    However, there’s no tag like {{tag_prefix}} where the TAG_PREFIX can be retrieved.

    Likewise, for author pages, for example,  https://example.com/AUTHOR_PREFIX/author-slug
    there’s no tag like {{author_prefix}} where the AUTHOR_PREFIX can be retrieved.

    #7834
    Bob

    Publii does not generate a tag prefix, so your breadcrumb can look like: https://example.com/tag_name1

    However,  including the current page in the breadcrumbs is not required by Google:

    If the breadcrumb is the last item in the breadcrumb trail, item is not required. If item isn’t included for the last item, Google uses the URL of the containing page.

    Look at the breadcrumb used on the google page: https://developers.google.com/search/docs/advanced/structured-data/breadcrumb

    google-breadcrump

    So personally, I would only use one element on tags page – a link to the home page and on tag pages, I would use an additional element with a link to tags pages e.g.  Home – Tags

    live example: https://demo.getpublii.com/themes/q-answer/1/tags/javascript/

     

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #7837
    shaun2k

    So personally, I would only use one element on tags page – a link to the home page and on tag pages, I would use an additional element with a link to tags pages e.g. Home – Tags

    Hi Bob,

    Thanks for your feedback.

    I have “products” for my “Tag prefix” in the URLs setting instead of the default “tags”.

    On the tag pages, the URLs I’m getting are like:

    • example.com/products/plastic-cards/
    • example.com/products/accessories/
    • example.com/products/lanyards/

    Using your same example, I would like to show “Home – Products” instead of “Home – Tags”. 

    I was hoping not to hardcode “Products” in my breadcrumb trail for my tag.hbs file but use a {{tagsPrefix}} 

    How can I make a helper to return {{tagsPrefix}} (urlsConfig.tagsPrefix found in Publii source code file, \app\back-end\modules\render-html\helpers\url.js)?

    Thanks.

    #7838
    Bob

    Tags page URL:  {{@website.tagsUrl}}

    Tags page title:  https://getpublii.com/dev/tags-page-tags/

     

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #7840
    candidexmedia

    So, assuming you customized the tags prefix names in your lang.json file (which is what I would recommend)…

     

    Try this for the products breadcrumb link:

    {{ translate 'tags.tagsPageTitle' }}

     

    #7841
    shaun2k

    Thanks Bob and Candide!

    Your suggestions worked great.  Shows I still have a lot to learn about Publii.

    Cheers!

    #7843
    candidexmedia

    Thanks Bob and Candide!

    Your suggestions worked great. Shows I still have a lot to learn about Publii.

    Cheers!

    I’m so happy to hear that!! 🥳

    I just found out about the lang.json stuff this past week while editing my portfolio site and changing the name of my tags as well. There’s always something new to learn about Publii. 😊

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.