Giter Club home page Giter Club logo

grav-plugin-breadcrumbs's People

Contributors

b1gg avatar danielflaum avatar flaviocopes avatar flesser avatar lufog avatar mahagr avatar regaez avatar rhukster avatar robwent avatar ryanmpierson avatar w00fz avatar yankl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

grav-plugin-breadcrumbs's Issues

Link trailing

As a non native speaker, can someone please explain the purpose of the setting "link trailing"?
Google was not as helpful as I hoped it would be.

Thanks in advance.

Schema.org migration

Current schema for breadcumps is deprecated by Google

data-vocabulary.org schema is deprecated and is no longer supported by Google. Please migrate to using schema.org types.

and will be ignored after April 2020. Consider movement to Schema.org

Breadcrumbs can't be added as a modular?

Making a breadcrumbs modular with:

{% if config.plugins.breadcrumbs.enabled %}
    {% include 'partials/breadcrumbs.html.twig' %}
{% endif %}

in it doesn't work. Only fa-home icon appears. Is it intentional? Is there any way I could put working breadcrumbs between modulars which are loaded through:

{% for module in page.collection() %}
    {{ module.content }}
{% endfor %}

?

Removing the plugin causes website crash

Removing the plugin causes website frontend crashes with error

RuntimeException (400) Template "partials/breadcrumbs.html.twig" is not defined in "blog.html.twig" at line 27.

After deleting the plugin config file left in user/config/plugins, site works again.

Composer.json name : Does not match the regex pattern

[...@... breadcrumbs]$ composer update


  [Composer\Json\JsonValidationException]
  "./composer.json" does not match the expected JSON schema:
   - name : Does not match the regex pattern ^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$

Works after changing name to getgrav/grav-plugin-breadcrumbs

Composer 2.1.14
PHP 7.4.25

Google Ends Rich Results for Data-Vocabulary.org Structured Data - transition to Schema.org

Hi,
many of you probably received an infotmation from google search console about error regarding Data-Vocabulary.org is being deprecated. here is the quick fix (it is really quick, spent 20min with it, not tested widely) to this to switch from Data-Vocabulary.org to the Shema.org which is supportted by Google now. It consists of 2 modifications:
1. breadcrumbs/templates/partials/breadcrumbs.html.twig

{% set crumbs = breadcrumbs.get() %}
{% set breadcrumbs_config = config.plugins.breadcrumbs %}
{% set divider = breadcrumbs_config.icon_divider_classes %}
{% set lang = "/"~html_lang %}
{% set siteurl = base_url_absolute|replace({ (lang) : ""}) %}

{% if crumbs|length > 1 or breadcrumbs_config.show_all %}
<ol id="breadcrumbs" itemscope itemtype="https://schema.org/Breadcrumblist">
    {% if breadcrumbs_config.icon_home %}
    <i class="{{ breadcrumbs_config.icon_home }}"></i>
    {% endif %}
	{% set position = 1 %}
    {% for crumb in crumbs %}
        {% if not loop.last %}
            {% if crumb.routable %}
			<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
                <a href="{{ siteurl }}{{ crumb.url }}" itemprop="item"><span itemprop="name">{{ crumb.menu }}</span></a>
				<meta itemprop="position" content="{{ position }}">
			</li>
            {% else  %}
			<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
                <span itemprop="name">{{ crumb.menu }}</span>
				<meta itemprop="position" content="{{ position }}">
			</li>
            {% endif %}
            <i class="{{ divider }}"></i>
        {% else %}
            {% if breadcrumbs_config.link_trailing %}
			<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
                <a href="{{ siteurl }}{{ crumb.url }}" itemprop="item"><span itemprop="name">{{ crumb.menu }}</span></a>
				<meta itemprop="position" content="{{ position }}">
			</li>
            {% else %}
			<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
                <span itemprop="name">{{ crumb.menu }}</span>
				<meta itemprop="position" content="{{ position }}">
			</li>
            {% endif %}
        {% endif %}
		{% set position = position + 1 %}
    {% endfor %}
</ol>
{% endif %}

2. breadcrumbs/css/breadcrumbs.css

#breadcrumbs {
    height: 3rem;
    line-height: 3rem;
    padding-left: 3rem;
}
#breadcrumbs li {
    display: inline-block;
    padding: 0 1rem;
}
#breadcrumbs ol {
    padding-left: 0;list-style:none;display:-webkit-inline-box;
}

#breadcrumbs i {
    display: inline-block;
    width: 20px;
    text-align: center;
} 

this will mage Google happy and you site will look exactly the same. You may test the structured data result here https://search.google.com/structured-data/testing-tool

Breadcrumbs doesn't recognize Flex Object path component

When I display a single Flex Object from a directory, the URL looks something like /about/careers/id:11025b4c30e0e7c93e8ab97dfd3611c7 but the bread crumbs display as About > Careers, ignoring the object component (e.g., About > Careers > My Object Title). This is using a Gantry-based theme but I don't think that's a factor.

FeatureRequest : Custom Breadcrumb Title

Hello I am Yoast Wordpress user can you please add breadcrumb title in admin please as I always use custom breadcrumb title for the page like my page name is Free Online Tutorials and Courses so I don't want this name in every page I want custom name like Tutorials only hope you understand, It will be great if you will consider adding it.

no breadcrumbs for search, archives, etc?

Maybe I am missing something as I am new to grav, but can't figure this one out. Breadcrumbs are working on all blog related pages, but pages like :

https://blog.example.com/search/query:hills

This one outputs the html with no pages included : 

<ol class="blog-breadcrumb" itemscope="" itemtype="http://schema.org/BreadcrumbList">
    </ol>
https://blog.example.com/archives_month:jul_2014
https://blog.example.com/tag:photography

These two only show the root level breadcrumb : 

<ol class="blog-breadcrumb" itemscope="" itemtype="http://schema.org/BreadcrumbList">
        	<li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem">
            				<a itemprop="item" href="/"><span itemprop="name">Blog</span></a>	
                    	<meta itemprop="position" content="1"> 
        </li>
    </ol>

Does it not work for these types or what is going on? The pages I mentioned use their respective plugins from the grav team. I am using the blog skeleton as my default.

Add option to ignore current page

I think it would be nice if there could be an option to include/exclude the current page on the breadcrumb trail, similar to how you can optionally include home.

(I'll open a PR for this soon)

Is not responsive?

It doesn't seem like this is mobile friendly. Long blog names distort the layout. As an interim fix, I made a small change to the else portion of the twig to keep everything on one line and within a mobile display.

<span itemprop="name">{{ crumb.menu|truncate(15) }}</span>

This is just a bandaid, I hope someone can help with some CSS guidance.

Thanks,
J

non-routable pages are included in breadcrumbs

I have a simple site only using pages and I have a hierarchy that nests some folders with markdown files with organizational folders without markdown files. Currently, the plugin adds these non-routable folders in the breadcrumbs list.

The simple fix, which seems to be working for me, is to check routability before adding to the hierarchy array in classes/breadcrumbs.php:

while($current && !$current->root()) {
     if($current->routable()) {
         $hierarchy[$current->url()] = $current;
     }
     $current = $current->parent();
 }

EDIT: Sorry for not making a PR. Being a bit lazy while working on the site. ;)

How to set "Home" link with custom text?

For not it takes the name from homepage title set in .md file. Is it possible to set it independent of homepage title?

For example, homepage title is "News around the world", and i want to make it just "Home".

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.