 |

articlexperts
Novice
Jan 29, 2007, 11:36 AM
Post #1 of 4
(320 views)
Shortcut
|
|
Article Man.2 :: Number of Words in each Article?
|
Can't Post
|
|
Hello: Just wondering if there is the option of adding the number of words in each article. We would like to display this information in our articles if possible. Any assistance would be greatly appreciated. Cheers to all, Kim articlexperts http://www.articlexperts.com
|
|
|  |
 |

Divya
User
Jan 29, 2007, 8:39 PM
Post #2 of 4
(307 views)
Shortcut
|
|
Re: [articlexperts] Article Man.2 :: Number of Words in each Article?
[In reply to]
|
Can't Post
|
|
Hi Kim Thanks for the post, I think you can be able to implement the word count feature for the articlePage.html page by applying javascript for counting number of words..As i am not an expert in it i am not sure how it will look.Like function countWords(){ document.form1.wordcount.value = document.form1.inputString.value.split(' ').length; } Try applying some javascript like this in your article page and let me know how you come up with it. Cheers Divya
|
|
|  |
 |

Luke
Staff
/ Moderator

Jan 30, 2007, 9:39 AM
Post #3 of 4
(292 views)
Shortcut
|
|
Re: [articlexperts] Article Man.2 :: Number of Words in each Article?
[In reply to]
|
Can't Post
|
|
Hi Kim, Divya's idea is a good one and I'll elaborate a little bit more on it. I'm not a JavaScript expert myself but what you could do is publish your article content to a hidden textarea, and then use some JavaScript similar to Divya's to count the number of words in that textarea. You could do this by adding the following code to your /templates/articlePages/articlePage.html template file. <textarea id="content" style="display: none;">$article.content:textOnly$</textarea> <script> var totalWords = document.getElementById("content").value.split(" ").length; document.write ("This article has " + totalWords + " words."); </script> Gives this a try and let me know if it works. Luke Holzken Product Development
|
|
|  |
 |

articlexperts
Novice
Feb 1, 2007, 6:17 AM
Post #4 of 4
(271 views)
Shortcut
|
|
Re: [Luke] Article Man.2 :: Number of Words in each Article?
[In reply to]
|
Can't Post
|
|
Thanks Luke, We'll give this a try. Best Regards, Kim
|
|
|  |
|