From 0cf03c6ab27ab989e75794d58fb572c839005ba4 Mon Sep 17 00:00:00 2001 From: MichaelDaum Date: Sun, 5 May 2013 08:24:26 +0000 Subject: [PATCH] Item8402: * added teaser sections to blog template * using WikiWorkbench's full-text rss and atom capabilities now * made comment counts pluggable * displaying disqus comment counts if in use * fixed link to posting author(s) * added changes in SeoTopic type to BlogEntry type * using relative urls by default now git-svn-id: http://svn.foswiki.org/trunk/BlogPlugin@16699 0b4bb1d4-4e5a-0410-9cc4-b2b747904278 --- data/Applications/BlogApp/BlogEntry.txt | 4 +- .../BlogApp/BlogEntryTemplate.txt | 11 ++++ .../BlogApp/BlogSearchViewTemplate.txt | 4 +- .../BlogApp/RenderBlogEntries.txt | 26 +++++---- .../Applications/BlogApp/RenderCategories.txt | 4 +- .../BlogApp/RenderNumberOfComments.txt | 55 +++++++++++++++++++ data/_BlogTemplate/WebRss.txt | 10 +--- data/_BlogTemplate/WebTopicEditTemplate.txt | 10 +++- lib/Foswiki/Plugins/BlogPlugin/MANIFEST | 5 +- 9 files changed, 103 insertions(+), 26 deletions(-) create mode 100644 data/Applications/BlogApp/BlogEntryTemplate.txt create mode 100644 data/Applications/BlogApp/RenderNumberOfComments.txt diff --git a/data/Applications/BlogApp/BlogEntry.txt b/data/Applications/BlogApp/BlogEntry.txt index 60c3c59..800acc5 100644 --- a/data/Applications/BlogApp/BlogEntry.txt +++ b/data/Applications/BlogApp/BlogEntry.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="micha" comment="reprev" date="1367600056" format="1.1" reprev="19" version="21"}% +%META:TOPICINFO{author="micha" comment="reprev" date="1367671217" format="1.1" reprev="19" version="23"}% %META:TOPICPARENT{name="TopicType"}% %DBCALL{"Applications.RenderTopicInstaller" TEXT="Install '%TOPIC%' TopicType" TYPE="TopicType"}% @@ -14,6 +14,7 @@ This is the central TopicType to store blog entries. EDITOR="Applications.BlogApp.BlogEntryEdit" EXTRA="" PARENT="none" + TEMPLATE="Applications.BlogApp.BlogEntryTemplate" }% %DBCALL{"Applications.RenderTopicsOfType" @@ -33,6 +34,7 @@ This is the central TopicType to store blog entries. | Author | text | 75 | | author(s) of this posting | | | State | radio | 2 | published, unpublished | only blog entries in state published are readable by other users; unpublished blog entries are only visible for the authors of this blog entry | | | Sticky | checkbox+values | 4 | on frontpage=frontpage, on category=category | a sticky blog entries is rendered at the top of the frontpage or category independent of the normal timeline | | +| HTML Title | text | 75 | | controls the title being added to the html page, defaults to TopicTitle if. %MAKETEXT{"Get from topic title."}% | | | Meta Description | textarea | 80x2 | | SEO description. Use a maximum of 160 chars for the description. %MAKETEXT{"Get description from content."}% | | | Meta Keywords | text | 75 | | SEO keywords. Specify a comma separate list of keywords. %MAKETEXT{"Get from classification."}% | | diff --git a/data/Applications/BlogApp/BlogEntryTemplate.txt b/data/Applications/BlogApp/BlogEntryTemplate.txt new file mode 100644 index 0000000..471b77d --- /dev/null +++ b/data/Applications/BlogApp/BlogEntryTemplate.txt @@ -0,0 +1,11 @@ +%META:TOPICINFO{author="micha" date="1367627921" format="1.1" version="1"}% +%META:TOPICPARENT{name="TopicTemplate"}% +%STARTSECTION{"teaser"}% + +%ENDSECTION{"teaser"}% + +%META:FORM{name="Applications.ApplicationTopic"}% +%META:FIELD{name="TopicType" title="TopicType" value="TopicTemplate"}% +%META:FIELD{name="TopicTitle" attributes="" title="TopicTitle" value="BlogEntryTemplate"}% +%META:FIELD{name="Summary" attributes="c" title="Summary" value=""}% +%META:FIELD{name="WikiApplication" attributes="" title="WikiApplication" value="BlogApp"}% diff --git a/data/Applications/BlogApp/BlogSearchViewTemplate.txt b/data/Applications/BlogApp/BlogSearchViewTemplate.txt index 846944e..978a3a4 100644 --- a/data/Applications/BlogApp/BlogSearchViewTemplate.txt +++ b/data/Applications/BlogApp/BlogSearchViewTemplate.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1305298837" format="1.1" reprev="4" version="4"}% +%META:TOPICINFO{author="micha" comment="reprev" date="1367666725" format="1.1" reprev="4" version="5"}% %META:TOPICPARENT{name="TopicView"}% %{}% %TMPL:INCLUDE{"SolrAjaxSearchView"}% @@ -108,7 +108,7 @@ {{if thumbnail}}
- ${title} + ${title}
{{/if}}
diff --git a/data/Applications/BlogApp/RenderBlogEntries.txt b/data/Applications/BlogApp/RenderBlogEntries.txt index 2ff1f92..0edc2d9 100644 --- a/data/Applications/BlogApp/RenderBlogEntries.txt +++ b/data/Applications/BlogApp/RenderBlogEntries.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="micha" comment="reprev" date="1358761665" format="1.1" reprev="24" version="24"}% +%META:TOPICINFO{author="micha" comment="reprev" date="1367740468" format="1.1" reprev="27" version="27"}% %META:TOPICPARENT{name="TopicFunction"}% %TOC{depth="2"}% @@ -58,14 +58,11 @@ This TopicFunction displays a collection of BlogEntries within the given CATegor format="

- $percntMETACOMMENTS{ - topic=\"$web.$topic\" - approval=\"on\" - format=\"
$dollarcount
\" - limit=\"1\" - singular=\"1\" - plural=\"$dollarcount\" - }$percnt +
+ $percntDBCALL{\"Applications.BlogApp.RenderNumberOfComments\" + THETOPIC=\"$web.$topic\" + COMMENTSYSTEM=\"%COMMENTSYSTEM{default="metacomment"}%\" + }$percnt
[[$web.$topic]] $percntIF{\"'$expand(State)' = 'unpublished'\" then=\"(%MAKETEXT{"unpublished"}%)\" @@ -74,7 +71,12 @@ This TopicFunction displays a collection of BlogEntries within the given CATegor
$expand(Summary')

$formatTime(createdate, '$day $mon $year') - | [[%USERSWEB%.$expand(createauthor)][$expand(createauthor)]] + | $percntFORMATLIST{ + \"$expand(Author or createauthor)\" + split=\"\s*,\s*\" + format=\"$dollarpercntIF{\\"istopic '%USERSWEB%.$1'\\" then=\\"[[%USERSWEB%.$1]]\\" else=\\"$1\\"}$dollarpercnt\" + separator=\", \" + }$percnt $percntCATINFO{ topic=\"$web.$topic\" header=\"| \" @@ -116,10 +118,10 @@ $percntDBCALL{\"$web.$topic\"}$percnt … [[$web
-« %MAKETEXT{"previous page"}% +« %MAKETEXT{"previous page"}% -= %COUNT%" then="style='display:none'"}% href='%SCRIPTURL{"view"}%/%BASEWEB%/%BASETOPIC%?skip=%CALC{"$GET(theNextSkip)"}%;limit=%LIMIT%%IF{"defined PARAMS" then="%PARAMS%"}%'>%MAKETEXT{"next page"}% » += %COUNT%" then="style='display:none'"}% href='%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?skip=%CALC{"$GET(theNextSkip)"}%;limit=%LIMIT%%IF{"defined PARAMS" then="%PARAMS%"}%'>%MAKETEXT{"next page"}% »
diff --git a/data/Applications/BlogApp/RenderCategories.txt b/data/Applications/BlogApp/RenderCategories.txt index 3583207..1d8d033 100644 --- a/data/Applications/BlogApp/RenderCategories.txt +++ b/data/Applications/BlogApp/RenderCategories.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1334852425" format="1.1" reprev="7" version="7"}% +%META:TOPICINFO{author="micha" comment="reprev" date="1367684180" format="1.1" reprev="7" version="8"}% %META:TOPICPARENT{name="TopicFunction"}% %TOC{depth="2"}% @@ -21,7 +21,7 @@ hidenull="on" depth="2" filter="TopicType=~'\bBlogEntry\b' AND State != 'unpublished'" - header="
+ header="

%IF{"defined CAT and '%CAT%' !='' and '%CAT%' != 'TopCategory'" then="%MAKETEXT{"[_1] categories" args="%CATINFO{cat="%CAT%" format="$title"}%"}%" else="%MAKETEXT{"Categories"}%" diff --git a/data/Applications/BlogApp/RenderNumberOfComments.txt b/data/Applications/BlogApp/RenderNumberOfComments.txt new file mode 100644 index 0000000..f06bbf9 --- /dev/null +++ b/data/Applications/BlogApp/RenderNumberOfComments.txt @@ -0,0 +1,55 @@ +%META:TOPICINFO{author="micha" comment="reprev" date="1367740466" format="1.1" reprev="1" version="1"}% +%META:TOPICPARENT{name="TopicFunction"}% +%TOC{depth="2"}% + +---++ Documentation +%STARTSECTION{"documentation"}% + +---+++++ Parameters + * THETOPIC to display the counts for + * COMMENTSYSTEM + +%ENDSECTION{"documentation"}% + +---++ Implementation + +%STARTINCLUDE%%DBCALL{ + "Applications.BlogApp.RenderNumberOfComments" + section="%COMMENTSYSTEM{default="metacomment"}%" +   THETOPIC="%THETOPIC{default="%BASEWEB%.%BASETOPIC%"}%" + warn="off" +}%%STOPINCLUDE% + +---+++ metacomment + +%STARTSECTION{"metacomment"}%%METACOMMENTS{ + topic="$web.$topic" + approval="on" + format="$count" + limit="1" + singular="1" + plural="$count" +}%%ENDSECTION{"metacomment"}% + + +---+++ disqus + +%STARTSECTION{"disqus"}%%DISQUS_COUNT{"%THETOPIC%"}%%ENDSECTION{"disqus"}% + + +---++ Test +%DBCALL{"%TOPIC%"}% + +%DBCALL{"Applications.RenderFunctionCallers"}% + +---++ Copyright +© 2005 2013 http://michaeldaumconsulting.com + +%DBCALL{"Applications.GnuGeneralPublicLicense" section="notice"}% + +%META:FORM{name="Applications.ApplicationTopic"}% +%META:FIELD{name="TopicType" title="TopicType" value="DocuTopic, TopicFunction"}% +%META:FIELD{name="TopicTitle" attributes="" title="TopicTitle" value=""}% +%META:FIELD{name="Summary" attributes="c" title="Summary" value=""}% +%META:FIELD{name="WikiApplication" attributes="" title="WikiApplication" value="BlogApp"}% +%META:PREFERENCE{name="EDIT_TEMPLATE" title="EDIT_TEMPLATE" type="Set" value="Applications.WikiTopicEdit"}% diff --git a/data/_BlogTemplate/WebRss.txt b/data/_BlogTemplate/WebRss.txt index ac20f68..554ae47 100644 --- a/data/_BlogTemplate/WebRss.txt +++ b/data/_BlogTemplate/WebRss.txt @@ -1,8 +1,4 @@ %META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.0" version="$Rev: 9914 $"}% - -%IF{ "$'URLPARAM{search}'!=''" then="<nop>%WIKITOOLNAME% search results for <nop>%URLPARAM{search}%" else="<nop>%WIKITOOLNAME%'s <nop>%WEB% web"}% - %SCRIPTURL{"view"}%/%WEB% - %MAKETEXT{"The [_1] web of Foswiki, the Free and Open Source Wiki." args="%WEB%"}% -%INCLUDE{"%SYSTEMWEB%.WebRssBase"}% + * Set VIEW_TEMPLATE = Applications.RssView + * Set FILTER = TopicType=~'\bBlogEntry\b' + * Set LIMIT = 5 diff --git a/data/_BlogTemplate/WebTopicEditTemplate.txt b/data/_BlogTemplate/WebTopicEditTemplate.txt index 5eefcfe..dbffe1b 100644 --- a/data/_BlogTemplate/WebTopicEditTemplate.txt +++ b/data/_BlogTemplate/WebTopicEditTemplate.txt @@ -1,6 +1,8 @@ -%META:TOPICINFO{author="ProjectContributor" comment="save topic" date="1299097553" format="1.1" reprev="1" version="1"}% +%META:TOPICINFO{author="micha" comment="save topic" date="1367628007" format="1.1" reprev="1" version="2"}% %META:TOPICPARENT{name="WebHome"}% +%STARTSECTION{"teaser"}% +%ENDSECTION{"teaser"}% %META:FORM{name="Applications.BlogApp.BlogEntry"}% %META:FIELD{name="TopicType" title="TopicType" value="BlogEntry, ClassifiedTopic, CategorizedTopic, TaggedTopic"}% @@ -8,3 +10,9 @@ %META:FIELD{name="Summary" attributes="" title="Summary" value=""}% %META:FIELD{name="Tag" attributes="" title="Tag" value=""}% %META:FIELD{name="Category" attributes="" title="Category" value=""}% +%META:FIELD{name="Author" attributes="" title="Author" value=""}% +%META:FIELD{name="State" attributes="" title="State" value="unpublished"}% +%META:FIELD{name="Sticky" attributes="" title="Sticky" value=""}% +%META:FIELD{name="MetaDescription" attributes="" title="Meta Description" value=""}% +%META:FIELD{name="MetaKeywords" attributes="" title="Meta Keywords" value=""}% +%META:DISQUS{name="21211fec12bb65e87ce0bb936929c2ef"}% diff --git a/lib/Foswiki/Plugins/BlogPlugin/MANIFEST b/lib/Foswiki/Plugins/BlogPlugin/MANIFEST index 278ffe4..597279c 100644 --- a/lib/Foswiki/Plugins/BlogPlugin/MANIFEST +++ b/lib/Foswiki/Plugins/BlogPlugin/MANIFEST @@ -2,6 +2,7 @@ data/Applications/BlogApp/ApplicationTopic.txt 0644 data/Applications/BlogApp/BlogEntry0.txt 0644 data/Applications/BlogApp/BlogEntryEditTemplate.txt 0644 data/Applications/BlogApp/BlogEntryRenderSolrSearchItem.txt 0644 +data/Applications/BlogApp/BlogEntryTemplate.txt 0644 data/Applications/BlogApp/BlogEntry.txt 0644 data/Applications/BlogApp/BlogEntryViewTemplate.txt 0644 data/Applications/BlogApp/BlogSearchViewTemplate.txt 0644 @@ -29,8 +30,10 @@ data/Applications/BlogApp/RenderBlogEntryPagination.txt 0644 data/Applications/BlogApp/RenderBlogEntryTitle.txt 0644 data/Applications/BlogApp/RenderCategories.txt 0644 data/Applications/BlogApp/RenderHelpText.txt 0644 +data/Applications/BlogApp/RenderNumberOfComments.txt 0644 data/Applications/BlogApp/RenderRecentBlogEntries.txt 0644 data/Applications/BlogApp/RenderRecentComments.txt 0644 +data/Applications/BlogApp/RenderRss.txt 0644 data/Applications/BlogApp/RenderSideBar.txt 0644 data/Applications/BlogApp/RenderSimilarBlogEntries.txt 0644 data/Applications/BlogApp/ReviewCategory.txt 0644 @@ -56,8 +59,8 @@ data/Applications/BlogApp/WebSearchAdvanced.txt 0644 data/Applications/BlogApp/WebSearch.txt 0644 data/Applications/BlogApp/WebStatistics.txt 0644 data/Applications/BlogApp/WebTool.txt 0644 +data/Applications/BlogApp/WebTopicEditTemplate.txt 0644 data/Applications/BlogApp/WebTopicList.txt 0644 -data/Applications/BlogApp/WebTopicViewTemplate.txt 0644 data/Applications/BlogApp/WikiApplication.txt 0644 data/Applications/BlogApp/WikiTopic.txt 0644 data/_BlogTemplate/BlogEntry.txt 0644