You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
$row->jcfields = FieldsHelper::getFields('com_content.article', $row, true);
foreach($row->jcfields as $jcfield){
$fullArticle .= $jcfield->rawvalue;
}
Could you add this fix in the next version?
Thanks
The text was updated successfully, but these errors were encountered:
Hi @patatagit
Thank you very much for your contribution!! You are right, we are not considering custom fields if they are not embedded in the article text.
My approach to this is that we cannot provide an exact amount of time or progress for the article as there are so many cases... So the reading time is an estimation based on the main content of the article.
Your suggestion will do great in some sites where they just use text fields or textareas, but if you are using a subform field type, probably it will provide weird results.
Nevertheless I myself have thought several times to ditch the article content and offer the author just custom fields to create their content, so considering custom fields sounds like a good idea to me.
To have a better idea on your case, can you please provide more context on your case? I'm sure we can get a good addition to the plugin from this.
Hi carcam,
you are right, some fields are different from text or textarea but in the most of case this fields contain a few string of code, I think they do not affect the counter significantly.
A solution could be to add an option in the configuration in order to include/exclude all the custom fields in the count of time. Selecting only the text fields could be a difficult task.
plg_readingtime does not counts the text included in custom fields.
The follow code add the Custom fields text to the counter
plg_readingtime/readingtime/readingtime.php
Line 96 in 298a797
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
$row->jcfields = FieldsHelper::getFields('com_content.article', $row, true);
foreach($row->jcfields as $jcfield){
$fullArticle .= $jcfield->rawvalue;
}
Could you add this fix in the next version?
Thanks
The text was updated successfully, but these errors were encountered: