GithubHelp home page GithubHelp logo

breadcrumbsbundle's Introduction

What's here?

Awesome Tech Ethics Resources

awesome-tech-ethics-resources: Resources for mitigating and avoiding the potential negative effects of technology on society.

Re-homed open source libraries

I'm providing a home for a number of open-source libraries from the whiteoctober organisation, since that organisation is due to be deleted.

I'm not able to maintain these (apart from the most minor tweaks), but having them here at least means they won't disappear when the organisation is deleted. So they're either looking for maintainers or have a preferred fork. Where there's a preferred fork, I've archived the repo and linked to it prominently.

One or two re-homed repos aren't exactly libraries but are just nice things I didn't want to lose with the demise of the org.

Tests, forks, etc

Repos for testing, forks of other repos so I can make Pull Requests; nothing to see here.

Exercise repos

Various technical exercises I've worked through have repos here. Not the best place to look to ascertain my technical skills, since they're experimental by nature. Again, not particularly worth your time.

Other things

That just leaves a handful:

And maybe some other things I've added in the meantime. But if they were really interesting, I'd probably have remembered to mention them here.

I have plenty of non-programming things to do in my free time, so my GitHub account isn't the best place to find evidence of my programming abilities - almost all of my professional work is on private repos elsewhere, sorry! You'll see little bits and bobs in others' public repos in the contributions section below, plus x contributions in private repositories, showing that I really do make contributions elsewhere, honest 😉.

My website (see sidebar) is probably a good next step, if you're interested in seeing my technical writing and presenting.

breadcrumbsbundle's People

Contributors

andrewmy avatar andreybolonin avatar balazslevi avatar bocharsky-bw avatar cocolabssas avatar coil avatar daamian avatar dxops avatar imctomhv avatar johnwards avatar mhujer avatar micotodev avatar modywzm avatar nickinthebox avatar pciacka avatar quentin-st avatar richsage avatar sampart avatar sander-toonen avatar simounet avatar soullivaneuh avatar sweoggy avatar toooni avatar wickedone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

breadcrumbsbundle's Issues

Support PHP-PM by resetting state

When using this bundle with php-pm the breadcrumbs show alls paths that all previous users have visited. E.g:

Home > Register > Home > Profile > Change Password > Home > Contact > Home > Contact, ... etc

This happens because WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs is a service that keeps state. Symfony 3.3 added a dependency injection tag that allows Symfony to call a reset()-method on the service after a request has been processed. This way, services can clean up any state so that a next request can be processed.

Symfony itself is already resetting certain services: symfony/symfony#23984

Since the Breadcrumbs class already has a clear() method that does exactly what is needed, adding the DI-tag should be all that is needed. I'll add a PR soon.

wrong branch in composer.json

in the README.md is
"whiteoctober/breadcrumbs-bundle": "master"

isn't it supose to be
"whiteoctober/breadcrumbs-bundle": "dev-master"

Config Parameter to change seperator class

I would suggest to create an parameter to be able to change the breadcrumbs divider class.

e.g. if you're using twitter bootstrap, you need to change the seperator class to "divider" instead of "seperator"

Mistake in documentation

Hello, Dave!

I have found a little mistake in documentation:

public function yourAction()
{
    $breadcrumbs = $this->get("white_october_breadcrumbs");
    $bc->addItem("Home", $this->get("router")->generate("index"));
    $bc->addItem("Register", $this->get("router")->generate("register"));
}

Variable $bc does not exist. It must be $breadcrumbs variable there.

Symfony 4 support

This bundle does not support Symfony4. Unless this bundle isn't maintained, which should be mentionned, Symfony4 should be added.

✌️

Add ability to pass route name instead of URL

Hey Rich,

Thanks for accepting PR #37.

Because I'm lazy sometimes, I'd love to be able to use the following format

$this->get('white_october_breadcrumbs')
    ->addItem('Home', '_homepage')
    ->addItem('Customers', 'acme_customer')
    ->addItem($customer->getName(), $this->get('router')->generate(
        'acme_customer_show', array(
            'slug' => $customer->getSlug(),
    )))
;

instead of

$this->get('white_october_breadcrumbs')
    ->addItem('Home', $this->get('router')->generate('_homepage'))
    ->addItem('Customers', $this->get('router')->generate('acme_customer'))
    ->addItem($customer->getName(), $this->get('router')->generate(
        'acme_customer_show', array(
            'slug' => $customer->getSlug(),
    )))
;

The third item is the same in both examples, by the way.

I'm pretty sure we can make this work with out breaking BC. Let me know if you're interested in a PR.

Cheers,

Tom

Can we add diferent class to each item in the menu ?

Hi good bundle but as you saw in the title i wanted add a class to each item in list, in order to do different action ... Because i want to add an auto completion on click on any item. My goal ... make dynamic breadcrumb, an user can modify it... I don't know if your bundle is the best solution ... is it ?

PS : Sorry for my bad english XD

Symfony 5

When possible update to symfony 5? :)

Remove "-" char in composer.json file

Hi,

I known it's a minor issue, but could you remove the "-" in the composer.json file ? When you add this bundle, Composer downloads the bundle in "vendor/white-october/breadcrumbs-bundle" whereas WO's others bundles are installed in "vendor/whiteoctober/[other-bundle]".

Thanks by advance

Render Controller

Is it posible to call render controller on the action that holds the pagination and if yes then how because i'm getting this error:

An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "" as such route does not exist.") in @appbundle\Survey\table_questions.html.twig at line 27.

Override default breadcrumbs class

I want to override Breadcrumbs in order to handle common logic and different subcontrollers.

Here, my DomainBreadcrumbs class:

<?php

namespace AppBundle\Breadcrumbs;

use AppBundle\Entity\Domain;
use Symfony\Component\Translation\TranslatorInterface;
use WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs;

/**
 * Class DomainBreadcrumbs
 */
class DomainBreadcrumbs extends Breadcrumbs
{
    /**
     * @var TranslatorInterface
     */
    private $translator;

    /**
     * Constructor
     *
     * @param TranslatorInterface   $translator
     */
    public function __construct(TranslatorInterface $translator)
    {
        $this->translator = $translator;
    }

    /**
     * @param Domain $domain
     *
     * @return DomainBreadcrumbs
     */
    public function makeShowItems(Domain $domain)
    {
        return $this
            ->addRouteItem($this->translator->trans('domain.breadcrumb.domains', [], 'front'), 'domain_index')
            ->addRouteItem($domain->getServer()->getName(), 'nexy_front_server_show', ['slug' => $domain->getServer()->getSlug()])
            ->addRouteItem($domain->getName(), 'domain_show', ['slug' => $domain->getSlug()])
        ;
    }
}

And the attached service declaration:

breadcrumbs.domain:
    class: AppBundle\Breadcrumbs\DomainBreadcrumbs
    parent: white_october_breadcrumbs
    arguments: [ @translator ]

Now, I try to use it on my controller:

public function showAction(Domain $domain)
{
    $this->get('breadcrumbs.domain')
        ->makeShowItems($domain)
    ;

    return $this->render('domain/show.html.twig', [
        'domain'    => $domain,
    ]);
}

But this doesn't render anything.

Is that an issue or perhaps did I something wrong?

View as option

Hello i would to know if it's possible to have the breabcrumbs in two different bundle with a different render (front and back).

It could be interresting to have the possibility to set the view in the option when wee call the helper.

Close hanged PRs

There are a few PRs (#30, #31, #32, #33) from @thseo for Oct 2013.

I think we have itemClass in order to config and use with Bootstrap3 as well, so I don't see a profit to merge this PRs. Could we close them at least?

P.S. @thseo was active on GitHub more than a year ago.

Stable version

Do you have any date for a stable version of your bundle ?

Thanks !

Error when you can render namespaces breadcrums

In microdata.html.twig there is a check:

if wo_breadcrumbs()|length ...

and in getBreadcrumbs() method of twig extension isset default value $namespace = Breadcrumbs::DEFAULT_NAMESPACE and this value is not transmitted in any way from wo_render_breadcrumbs({namespace: "my-namespace"}) function.
Because of this, you will never get breadcrumbs from the custom namespace in default template.

I solved it this way:

  1. Override default template
  2. Remove this check (if wo_breadcrumbs()|length)
  3. do this check in my main template:
{% for c in item.categories %}
	{% if wo_breadcrumbs("namespace-" ~ c.id)|length  %}
		{{ wo_render_breadcrumbs({namespace: "namespace-" ~ c.id}) }}
	{% endif %}
{% endfor %}

You still accept pull requests in this repos?

Possible to create dynamic namespace without exception

Hello.
I had problem, when I created dynamic namespaces for differend user roles.
I would like propose to add this code in your repo:
into BreadcrumbsExtension class:

public function getFunctions()
{
    return array(
        new \Twig_SimpleFunction("wo_breadcrumbs", array($this, "getBreadcrumbs"), array("is_safe" => array("html"))),
        new \Twig_SimpleFunction("wo_render_breadcrumbs", array($this, "renderBreadcrumbs"), array("is_safe" => array("html"))),
        new \Twig_SimpleFunction("wo_breadcrumbs_exists", array($this, "hasBreadcrumbs"), array("is_safe" => array("html"))),
    );
}

and method:

public function hasBreadcrumbs($namespace = Breadcrumbs::DEFAULT_NAMESPACE)
{
    return $this->breadcrumbs->hasNamespaceRegistered($namespace);
}

and in Breadcrumbs model class:

public function hasNamespaceRegistered($namespace = self::DEFAULT_NAMESPACE)
{
    return isset($this->breadcrumbs[$namespace]);
}

Thank you.

override the template in Symfony 4

Hi,

could you, please, tell me how I can do to override the template microdata.html.twig in Symfony 4 and in which directories. I looked in the symfony's documentation, I made this directories but It don't display my template.
templates/bundles/WhiteOctoberBreadcrumbsBundle/WhiteOctober/microdata.html.twig

Thanks for your help.

Make addItem() return $this (chaining)

Hi,

thanks for this bundle, works like a charm!

Do you think it would be a good idea if the method WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs:addItem() returned $this so one could chain the item setup like this... ?

$this->get("white_october_breadcrumbs")
            ->addItem("Home", $this->get("router")->generate("index"))
            ->addItem("Other Stuff", $this->get("router")->generate("stuff"))
            ->addItem(...);

Dunno if i should fork your repository for just one line of code. :)

Usage as a Singleton

Is there a way to use the breadcrumbs as a singleton?

I'd like to set the breadcrumbs global on kernel.controller but i'd also like to add additional breadcrumbs via the controller.

e.g.

addItem('home');
if (foo){
addItem('members");

and then inside of the controller i'd like to set the last item.

if i do this in the controller, the items which i added on kernel.controller are deleted

if it's not possible, i'd like to suggest this:)

Ability to prepend items

Hi there,

I love this bundle. I'd like to be able to use it with nested set data, e.g. an account hierarchy:

Assets /
    Bank Accounts /
        Checking Account

I'd like to be able to prepend items in order to use the getParent() method on my entity; something like this:

$breadcrumbs = $this->get("white_october_breadcrumbs");

while ($account = $account->getParent()) {
    $breadcrumbs->prependItem($account->getName(), $this-get('router')->generateUrl(
        'account_show', array('path' => $account->getPath())
    ));
}

Let me know if this is something you guys are working on or if you want me to submit a pull request.

Cheers,

Tom

optional translation

would it be of added value to make translations optional for a breadcrumb item?

$breadcrumbs->addItem($user->getUsername(), '', [], false);

of course now the translator fails silently and simply outputs the input string, however, it does raise an additional translation.WARNING

Error in documentation

Hi,

The main documentation refers to a addObject method.
It doesn't seem it exists; addObjectArray seem to have the described behavior. Maybe it'll useful to precise objects must gave getters.

Anyway, thanks for this great bundle

set defaults via config.yml

I like to set defaults configs by:

white_october_breadcrumbs:
helper:
separator: ''
listId: 'jCrumbs'
listClass: 'breadCrumb module'

is it possible?

Composer?

Any chance you could throw up a Composer package for this bundle?

Symfony 5

Its possible add symfony 5 support to composer.json please?

Confusing advanced usage

Hi,
in your README.md, you describe two advanced methods, to use your plugin.
Could you please provide more detailed examples, because it is really hard to get what you mean.
Thanks in advance

Rewrite installation chapter of docs

What about to rewrite Installation chapter of the docs a bit?
I think we must to notice that installation via Composer is preferred choice and move it upper.

Looking for maintainers

Hi,

Sam here, one of the current maintainers of this project.

Given that we no longer use Symfony in any of our active projects, it's becoming harder to give this plugin the time it needs.

Therefore, we're looking for new maintainer(s) for this project.

We'd like any new prospective maintainer to fork this project, and then once that fork has moved forward enough to give us confidence in your ownership, we would link to your fork prominently from the top of the README here, encouraging others to use it instead.

If you're interested, please go ahead and fork (if you haven't already) and start work! If you've forked and would like others to help you, feel free to reply in this issue with details of your fork.

Please do reply here if you have questions. Thanks in anticipation.

Add integration tests

It would be great to have some tests of this against various different versions of Symfony.

The spaceless tag is deprecated since Twig 2.7, use the spaceless filter instead

With a recent version of Twig I'm getting a deprecation warning because the use of the spaceless tag in the template: https://github.com/whiteoctober/BreadcrumbsBundle/blob/78214890393fa5dd9cea632873ee10e0a290b33b/Resources/views/microdata.html.twig#L1-L3

It suggests to use spaceless filter instead. But only to avoid extra whitespace between HTML tags to avoid browser rendering quirks under some circumstances.

On the other hand, it says:

If you want to optimize the size of the generated HTML content, gzip compress the output instead.

So the question is for which reason is the spaceless used here. Should it be replaced with a filter or removed?

Service "white_october_breadcrumbs" not found

Hi,

With Symfony 4, when I want to use the service "white_october_breadcrumbs" in my controller with the code:

$breadcrumbs = $this->get("white_october_breadcrumbs");

I have the following error:

Service "white_october_breadcrumbs" not found: even though it exists in the app's container, the container inside "App\Controller\MenuController" is a smaller service locator that only knows about the "doctrine", "form.factory", "http_kernel", "parameter_bag", "request_stack", "router", "security.authorization_checker", "security.csrf.token_manager", "security.token_storage", "serializer", "session", "templating" and "twig" services.Try using dependency injection instead.

Can you help me ?

Add Annotation Support

Would be really cool to specify breadcrumbs via annotations :)

Idk if this makes sense to you, but a discussion would be nice

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.