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

Minutes to read doesn't work with Elemental #613

Open
ec8or opened this issue Jul 2, 2020 · 0 comments
Open

Minutes to read doesn't work with Elemental #613

ec8or opened this issue Jul 2, 2020 · 0 comments

Comments

@ec8or
Copy link

ec8or commented Jul 2, 2020

I'm using Elemental blocks which causes the minutes to read to stop working as there's no "Content" field. Had to do this to get the word count from the blocks instead:

        $wordCount = 0;
        if ($this->owner->ElementalArea()->exists()) {
            $elementalArea = $this->owner->ElementalArea();
            foreach($elementalArea->Elements() as $element) {
                $wordCount += str_word_count(strip_tags($element->HTML));
            }
        }

This would obviously depend on what sort of blocks people are using so might just push the issue along but wondering if worth cleaning this up a bit and use if ElementalPageExtension is active? Or at least include a mention of it in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants