Skip to content

Minutes to read doesn't work with Elemental #613

@ec8or

Description

@ec8or

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions