Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to change the Powered By template #1047

Closed
Jerska opened this issue May 31, 2016 · 3 comments
Closed

Ability to change the Powered By template #1047

Jerska opened this issue May 31, 2016 · 3 comments
Assignees

Comments

@Jerska
Copy link
Member

Jerska commented May 31, 2016

I'm handling internationalization of the search in Algolia for Zendesk right now and the string "Search by Algolia" is the only one I'm not able to change depending of the language.

I can hack it by passing poweredBy: false to the widget and manually adding it myself, but I feel like we could just provide a template to replace the PoweredBy component on the SearchBox widget.

@pixelastic
Copy link
Contributor

Yep, agreed. Care to do a PR?

@pixelastic pixelastic self-assigned this May 31, 2016
@pixelastic
Copy link
Contributor

Actually, I'm taking care of that.

pixelastic added a commit that referenced this issue May 31, 2016
Fixes: #1047

You can now pass an object to `poweredBy` like this:

```javascript
poweredBy: {
  template: 'Link to {{data.url}}', // Also accepts function
  cssClasses: {
    root: 'applied to wrapper',
    link: 'applied to link'
  }
}
```

Everything is handled directly in the widget, without the need for
a React component. This was overkill because we never update the
render of the `poweredBy` so it was easier to just generate the
template at init time without going through all the process of
creating a template.

I've also added more thorough tests. Users will be able to
independently change CSS classes or template.
@pixelastic
Copy link
Contributor

Suggested a PR here: #1048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants