Question

Does anyone know where "or" is generated from, as in "Sign In or Create An Account" in the bar at the top of every page? It does not appear to be part of either link, just placed there to separate them. I simply want to remove "or" from every page.

I am using Magento CE version 2.0.7-0 on an offline Linux home test server, with the Luma theme. The install was from a Bitnami package download.

My folder structures, in part, are like this:
/home/krang/magento-2.0.7-0/apps/magento/htdocs/vendor/magento/

I have been able to remove "Sign In" and "Create An Account" in their respective files:

return $this->isLoggedIn() ? __('Sign Out') : __('Sign In');

<referenceBlock name="register-link" remove="true"/>

I have tried both

<referenceBlock name="authorization-link" remove="true"/>

and

<referenceBlock name="authorization-link-login" remove="true"/>

to no avail.

I have also tried Developer debug and numerous searches, but none of them panned out.

“or” appears to be called a data-label, but I haven't been able to find out where this comes from:

<li class="authorization-link" data-label="or">

Thanks everyone.

Was it helpful?

Solution

it's defined in the data-label attribute of the li in the template:

https://github.com/magento/magento2/blob/2.0/app/code/Magento/Customer/view/frontend/templates/account/link/authorization.phtml#L15

It seems to be rendered by a js function. If you remove the data-label attribute, the or should be gone

OTHER TIPS

It's actually a css :after property that draws from the data-label attribute.

From luma's _module.less:

> .authorization-link {
                    &:after {
                        content: attr(data-label);
                        display: inline-block;
                        margin: 0 -@indent__xs 0 @indent__xs;
                    }
                }
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top