최근 검색
최근 검색 없음

Frank Perazelli
가입한 날짜: 2021년 5월 13일
·
마지막 활동: 2021년 10월 27일
팔로잉
0
팔로워
1
총 활동 수
16
투표 수
4
플랜 수
3
활동 개요
배지
문서
게시물
커뮤니티 댓글
문서 댓글
활동 개요
님의 최근 활동 Frank Perazelli
Frank Perazelli님이 에 댓글을 입력함
@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
댓글 보기 · 2016년 1월 14일에 게시됨 · Frank Perazelli
0
팔로워
0
투표 수
0
댓글
Frank Perazelli님이 에 댓글을 입력함
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.
댓글 보기 · 2015년 7월 21일에 게시됨 · Frank Perazelli
0
팔로워
0
투표 수
0
댓글
Frank Perazelli님이 에 댓글을 입력함
@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.
댓글 보기 · 2015년 6월 24일에 게시됨 · Frank Perazelli
0
팔로워
0
투표 수
0
댓글
Frank Perazelli님이 에 댓글을 입력함
@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...
댓글 보기 · 2015년 6월 16일에 게시됨 · Frank Perazelli
0
팔로워
0
투표 수
0
댓글
Frank Perazelli님이 에 댓글을 입력함
@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.
댓글 보기 · 2015년 1월 09일에 게시됨 · Frank Perazelli
0
팔로워
0
투표 수
0
댓글
Frank Perazelli님이 에 댓글을 입력함
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...
댓글 보기 · 2015년 1월 08일에 게시됨 · Frank Perazelli
0
팔로워
2
투표 수
0
댓글
Frank Perazelli님이 에 댓글을 입력함
@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
댓글 보기 · 2014년 11월 24일에 게시됨 · Frank Perazelli
0
팔로워
0
투표 수
0
댓글