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

Customising the content that are being analysed #1

Open
TWOC-WHT opened this issue Apr 4, 2021 · 9 comments
Open

Customising the content that are being analysed #1

TWOC-WHT opened this issue Apr 4, 2021 · 9 comments

Comments

@TWOC-WHT
Copy link

TWOC-WHT commented Apr 4, 2021

Currently the content that are being analysed is the whole source code of the preview (Which includes the header, navbar, footer, and other parts of the page)
Is there a way to customise or filter the content before analysing?

@Aleksi44
Copy link
Owner

Aleksi44 commented Apr 4, 2021

Hi @TWOC-WHT

Currently no. It can be done quite simply with this solution :

We can add a new field (like keywords) in the Yoast Wagtail panel, something like this:

# Filter the contents of the preview page with a jQuery selector
filter_selector =  models.CharField(...)

What do you think about this?

@TWOC-WHT
Copy link
Author

TWOC-WHT commented Apr 6, 2021

Hi @Aleksi44 thanks for the reply!
That's interesting! Let me see if I get this right:
So in the filter_selector, we will fill the part of the content we would like to analyse with a jQuery selector?
i.e. if the part that we would like to analyse has the class "content", the filter_selector will be filled ".content"

@Aleksi44
Copy link
Owner

Aleksi44 commented Apr 6, 2021

@TWOC-WHT

Yes, you got it. Is that what you want?

@TWOC-WHT
Copy link
Author

TWOC-WHT commented Apr 6, 2021

@Aleksi44 ah yes, that could do! Thank you very much!

@Aleksi44
Copy link
Owner

Aleksi44 commented Apr 6, 2021

@TWOC-WHT

Cool, I'll do it when I have some time (next week I think).

@TWOC-WHT
Copy link
Author

TWOC-WHT commented Apr 6, 2021

@Aleksi44 Great! look forward to it and will definitely try it out!
Oh and thank you for creating this package!

@TWOC-WHT
Copy link
Author

TWOC-WHT commented May 7, 2021

Hi @Aleksi44 are there any update regarding this? Is there anything that I can help with?
I don't mind to look into it myself, although I might need some pointers on where to start (i.e. which files to pay attention to or which documentation I can refer to)

@Aleksi44
Copy link
Owner

Hi @TWOC-WHT
I have started to do the work on this PR to guide you if you wish to move forward on this subject.

@TWOC-WHT
Copy link
Author

@Aleksi44 Thanks! will look into it!

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