wagtailyoast
wagtailyoast copied to clipboard
Customising the content that are being analysed
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?
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?
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"
@TWOC-WHT
Yes, you got it. Is that what you want?
@Aleksi44 ah yes, that could do! Thank you very much!
@TWOC-WHT
Cool, I'll do it when I have some time (next week I think).
@Aleksi44 Great! look forward to it and will definitely try it out! Oh and thank you for creating this package!
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)
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.
@Aleksi44 Thanks! will look into it!