Recent searches
No recent searches

Frank Perazelli
Joined May 13, 2021
·
Last activity Oct 27, 2021
Following
0
Follower
1
Total activity
16
Votes
4
Subscriptions
3
ACTIVITY OVERVIEW
BADGES
ARTICLES
POSTS
COMMUNITY COMMENTS
ARTICLE COMMENTS
ACTIVITY OVERVIEW
Latest activity by Frank Perazelli
Frank Perazelli commented,
@Gizem
Here is the relevant code from my JS that produces what you are looking for:
// Limit Article List to display only 3 entries
if (document.location.href.indexOf('section') == -1 ) {
var categories = $('ul.article-list');
for (var j = categories.length - 1; j >= 0; j--) {
var articles = $(categories[j]).find('li');
var articleCount = articles.length;
var moreLink = $(categories[j]).siblings('.see-all-articles');
var moreArticles = moreLink.text();
if (moreArticles != "") {
articleCount = moreArticles.replace("See all","");
articleCount = +articleCount.replace("articles","");
moreLink.hide();
}
if ( articles.length > 3 ) {
for (var k = 3; k < articles.length; k++ ) {
$(articles[k]).hide();
}
}
// change the heading title
var catHeader = $(categories[j]).parent().find('h3 a');
var catTitle = $(catHeader).text();
var catHref = $(catHeader).attr('href');
$(catHeader).text(catTitle
//+ " (" + articleCount + ")"
);
if (articleCount > 3) {
var newSeeAllText = 'See all ' + articleCount + ' articles';
var newSeeAll = $(categories[j]).append(newSeeAllText);
}
}}
Hope this helps.
Frank on aarpfoundationtaxaide.zendesk.com
View comment · Posted Jan 14, 2016 · Frank Perazelli
0
Followers
0
Votes
0
Comments
Frank Perazelli commented,
This code works OK on my HC:
// Limit Article List to display only 3 entries
if (document.location.href.indexOf('section') == -1 ) {
var categories = $('ul.article-list');
for (var j = categories.length - 1; j >= 0; j--) {
var articles = $(categories[j]).find('li');
var articleCount = articles.length;
var moreLink = $(categories[j]).siblings('.see-all-articles');
var moreArticles = moreLink.text();
if (moreArticles != "") {
articleCount = moreArticles.replace("See all","");
articleCount = +articleCount.replace("articles","");
moreLink.hide();
}
if ( articles.length > 3 ) {
for (var k = 3; k < articles.length; k++ ) {
$(articles[k]).hide();
}
}
// change the heading title
var articleCount = " (" + articleCount + ")";
var catTitle = $(categories[j]).parent().find('h3 a').text();
$(categories[j]).parent().find('h3 a').text(catTitle + articleCount);
}}
Hope this solves your situation.
View comment · Posted Jul 21, 2015 · Frank Perazelli
0
Followers
0
Votes
0
Comments
Frank Perazelli commented,
@Geoff - I've compared what is working on our site to the code above. The only difference is this:
// change the heading title
var catHeader = $(categories[j]).parent().find('h3 a');
var catTitle = $(catHeader).text();
var catHref = $(catHeader).attr('href');
$(catHeader).text(catTitle
//+ " (" + articleCount + ")"
);
if (articleCount > 3) {
var newSeeAllText = 'See all ' + articleCount + ' articles';
var newSeeAll = $(categories[j]).append(newSeeAllText);
}
}}
See attached screen shot. If less than 3 articles, the "See all ..." does not appear.
Hope this helps.
View comment · Posted Jun 24, 2015 · Frank Perazelli
0
Followers
0
Votes
0
Comments
Frank Perazelli commented,
@Erik - You can reduce the height of the Section blocks by adjusting the CSS for .section-tree h3
line-height: 60px;
This will reduce the amount of scrolling to see all your sections...
View comment · Posted Jun 16, 2015 · Frank Perazelli
0
Followers
0
Votes
0
Comments
Frank Perazelli commented,
No that option does not yet exist. You can only Follow from a Section, each on individually. Sorry...
View comment · Posted Jan 09, 2015 · Frank Perazelli
0
Followers
0
Votes
0
Comments
Frank Perazelli commented,
@Jose - No any user can Follow any or all Sections.
View comment · Posted Jan 09, 2015 · Frank Perazelli
0
Followers
0
Votes
0
Comments
Frank Perazelli commented,
@Jose - Unfortunately the option currently available is to Follow a Section. As the Admin for my Help Center I follow all Sections so that when an author adds an article I get a notification. If you permit Comments to your articles, you can follow the article comments.
View comment · Posted Jan 09, 2015 · Frank Perazelli
0
Followers
0
Votes
0
Comments
Frank Perazelli commented,
We ask our users to Follow the Section. When we post a new article an email is generated to users Following that Section. If we do a major update, we temporarily remove the article by making it a draft item, Update the article and then make our edits, remove the draft checkmark and Update. This is now seen as a new article and out goes an email...
View comment · Posted Jan 08, 2015 · Frank Perazelli
0
Followers
2
Votes
0
Comments
Frank Perazelli commented,
@Wes - Several months ago we used a modification of your code to display the article count in parens following the Section name. In our code we used a split function which suddenly ceased working on 11/18/14. It was necessary to find a work around since Support could not locate the difficulty. I am listing both versions or our code for reference.
// Limit Article List to display only 3 entries - ORIGINAL CODE
if (document.location.href.indexOf('section') == -1 )
{
var categories = $('ul.article-list');
for (var j = categories.length - 1; j >= 0; j--)
{
var articles = $(categories[j]).find('li');
var articleCount = articles.length;
var moreLink = $(categories[j]).siblings('.see-all-articles');
var moreArticles = moreLink.text();
if (moreArticles != "") {
/* THIS IS WHAT FAILED */
var splitText = moreArticles.split(" ");
articleCount = splitText[2];
/* ------------------------------- */
moreLink.hide();
}
if ( articles.length > 3 )
{ for (var k = 3; k < articles.length; k++ )
{ $(articles[k]).hide(); } }
// change the heading title
var articleCount = " (" + articleCount + ") »";
var catTitle = $(categories[j]).parent().find('h3 a').text();
$(categories[j]).parent().find('h3 a').text(catTitle + articleCount);
} }
// Limit Article List to display only 3 entries - NEW CODE
if (document.location.href.indexOf('section') == -1 ) {
var categories = $('ul.article-list');
for (var j = categories.length - 1; j >= 0; j--) {
var articles = $(categories[j]).find('li');
var articleCount = articles.length;
var moreLink = $(categories[j]).siblings('.see-all-articles');
var moreArticles = moreLink.text();
if (moreArticles != "") {
articleCount = moreArticles.replace("See all","");
articleCount = +articleCount.replace("articles","");
moreLink.hide(); }
if ( articles.length > 3 ) {
for (var k = 3; k < articles.length; k++ ) {
$(articles[k]).hide(); } }
// change the heading title
var articleCount = " (" + articleCount + ")";
var catTitle = $(categories[j]).parent().find('h3 a').text();
$(categories[j]).parent().find('h3 a').text(catTitle + articleCount);
}}
Support suggested we post this for others reference.
Frank
View comment · Posted Nov 24, 2014 · Frank Perazelli
0
Followers
0
Votes
0
Comments