最近の検索
最近の検索はありません

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
コメント