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

Executing a search via javascript #378

Closed
beall49 opened this issue Nov 22, 2017 · 3 comments
Closed

Executing a search via javascript #378

beall49 opened this issue Nov 22, 2017 · 3 comments

Comments

@beall49
Copy link

beall49 commented Nov 22, 2017

Hi we're new to Liferay/Lexicon and we've recently implemented a search bar in a theme using lexicon styling.

<div class="form-group">
    <div class="input-group">
        <input class="form-control" placeholder="Search for..." type="text">
        <span class="input-group-btn">
            <button class="btn btn-default" type="button">Search</button>
        </span>
     </div>
</div>

I know there's multiple parameters that are needed for the search results popup/overlay, but we're hoping there's a way to get to them. Possibly similar to the liferay-ui objects e.g. user-icon, alerts, etc. Can we just execute the search via javascript somehow?

Do we have to implement the search portlet to do this? <@liferay.search/> If so, are their examples of applying the lexicon styling to it?

I feel like I'm missing something simple, forgive me if I am.

Thanks

@jonmak08
Copy link

Hi @beall49,

You can do a search via javascript in Liferay, using portlet-url (https://github.com/liferay/liferay-portal/blob/master/modules/apps/foundation/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/portlet_url.js) to construct the url and paramaters you might need to pass in.

Here is a really old blog describing how to use it https://web.liferay.com/web/eduardo.lundgren/blog/-/blogs/liferay-portleturl-in-javascript.

Please let me know if you have any questions. Thanks!

@jonmak08
Copy link

For future requests regarding Liferay specific issues, you can post your questions in our forums (https://web.liferay.com/community/forums) or join our chat (https://community-chat.liferay.com/) which should be able to provide you a quicker response.

Thanks!

@beall49
Copy link
Author

beall49 commented Nov 22, 2017

That looks perfect, I'll close this, if I have issues going forward I'll use the forums. Thanks again, appreciate it.

@beall49 beall49 closed this as completed Nov 22, 2017
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

2 participants