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

Allow for #anchor in search results #90

Open
tehfink opened this issue Oct 10, 2018 · 0 comments
Open

Allow for #anchor in search results #90

tehfink opened this issue Oct 10, 2018 · 0 comments

Comments

@tehfink
Copy link

tehfink commented Oct 10, 2018

Apologies if this has been addressed before, or if my thinking is off-base:

I have a plugin which returns a link to itself on a Page, e.g.:

def get_absolute_url(self):
        return f"{self.placeholder.page.get_absolute_url(language=self.language, fallback=False)}#{self.slug}"

It would be nice if the search results allowed for the plugin to override the Title's url, as otherwise the user must click the link, and then scroll/search to again find the plugin's text somewhere on the page.
I think it could be accomplished by allowing the plugin to override the Title's get_url() here:
https://github.com/aldryn/aldryn-search/blob/1f8c68aa6d7283d940e77d226bc9b5b9a17f2672/aldryn_search/search_indexes.py#L37-L38

Thoughts?

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

1 participant