yii2-authclient
yii2-authclient copied to clipboard
yii\authclient\widgets\AuthChoice displays nothing by default
Do: Use this widget to create a list of login links in the way it is displayed in the docs.
Expect: I would expect something that works out of the box and displays either a button or a link with the name of the provider.
Actual: What you get is an invisible link(s) with no text since the widget appears to put a blank string as the content of the span inside the link. The provider name does get added to the class of both the link and the inner span but surely, at least by default, should also be the inner text of the span?
This might be a documentation issue, maybe I should have added other properties to the widget?
What would possibly make more sense is that if there is no custom text set, it adds the name of the provider in the link. It should probably also allow custom "class" so that it can be e.g. a button or a link depending on what the user wants.
Again, happy to PR if I can have some direction on whether it is a docs issue, or whether some improvements could be made?
These links should be CSS-styled.
I will make a PR for the docs, although I don't see how to easily style them with css. It works if I used a.Provider:after { content: "Provider name"; }
but that seems a bit weird - why use a span if you can write the text directly into the link?
Maybe it only really works properly when used in the custom style. I think we could maybe make this nicer but happy to park after making it clearer in the docs.
I mean they're styled out of the box. Widget should register CSS assets needed.
OK, I'll look. It might be because my site does not use Bootstrap.
It only styles the built-in clients using the icons from authchoice.png If you create a custom client based on e.g. OpenIdConnect, it displays a transparent icon and no text. Please let me know whether you think the instructions should be changed to tell the developer what to do or whether some code needs changing to make clients without the built-in names to display something.
Indeed it won't work for custom clients. Not sure what's the best way to solve it so it could be extended easily. Any idea?
What about extending the icon image to include the letters A-Z as well as Google, Twitter etc. so that a property on the config could be, say, iconLetter => 'P' which will set the correct css class to offset the image. Also, if the user wants their own image, then we could extend the instructions to say where to put the image and what css would be required to do the same thing as the plugin does for Google, Twitter etc.?
Yes, that sounds like a good option.
I feel that adding 26 tiles to our sprite is a bit "too much" for people using only Facebook or Twitter.
Documenting how to use your own images would be better.
Agree.