wagtailyoast icon indicating copy to clipboard operation
wagtailyoast copied to clipboard

Customising the content that are being analysed

Open TWOC-WHT opened this issue 3 years ago • 9 comments

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?

TWOC-WHT avatar Apr 04 '21 01:04 TWOC-WHT

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?

Aleksi44 avatar Apr 04 '21 10:04 Aleksi44

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 avatar Apr 06 '21 01:04 TWOC-WHT

@TWOC-WHT

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

Aleksi44 avatar Apr 06 '21 08:04 Aleksi44

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

TWOC-WHT avatar Apr 06 '21 08:04 TWOC-WHT

@TWOC-WHT

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

Aleksi44 avatar Apr 06 '21 08:04 Aleksi44

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

TWOC-WHT avatar Apr 06 '21 08:04 TWOC-WHT

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)

TWOC-WHT avatar May 07 '21 03:05 TWOC-WHT

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 avatar May 12 '21 07:05 Aleksi44

@Aleksi44 Thanks! will look into it!

TWOC-WHT avatar May 12 '21 07:05 TWOC-WHT