Skip to content

Commit

Permalink
Item8402:
Browse files Browse the repository at this point in the history
   * 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
  • Loading branch information
MichaelDaum authored and MichaelDaum committed May 5, 2013
1 parent 3d73720 commit 0cf03c6
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 26 deletions.
4 changes: 3 additions & 1 deletion 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"}%

Expand All @@ -14,6 +14,7 @@ This is the central TopicType to store blog entries.
EDITOR="Applications.BlogApp.BlogEntryEdit"
EXTRA="<input type='hidden' name='State' value='unpublished' /><input type='hidden' name='DISPLAYCOMMENTS' value='on' />"
PARENT="none"
TEMPLATE="Applications.BlogApp.BlogEntryTemplate"
}%

%DBCALL{"Applications.RenderTopicsOfType"
Expand All @@ -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 <nop>TopicTitle if. <a href='#' id='clsFetchTitle'>%MAKETEXT{"Get from topic title."}%</a> | |
| Meta Description | textarea | 80x2 | | SEO description. Use a maximum of 160 chars for the description. <a href='#' id='clsFetchDescription'>%MAKETEXT{"Get description from content."}%</a> | |
| Meta Keywords | text | 75 | | SEO keywords. Specify a comma separate list of keywords. <a href='#' id='clsFetchKeywords'>%MAKETEXT{"Get from classification."}%</a> | |

Expand Down
11 changes: 11 additions & 0 deletions 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="<nop>TopicTitle" value="BlogEntryTemplate"}%
%META:FIELD{name="Summary" attributes="c" title="Summary" value=""}%
%META:FIELD{name="WikiApplication" attributes="" title="WikiApplication" value="BlogApp"}%
4 changes: 2 additions & 2 deletions 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"}%
%{<verbatim class="tml">}%
%TMPL:INCLUDE{"SolrAjaxSearchView"}%
Expand Down Expand Up @@ -108,7 +108,7 @@
</h2>
{{if thumbnail}}
<div class="foswikiRight foswikiImage">
<img src='%SCRIPTURL{"rest"}%/ImagePlugin/resize?topic=${web}.${topic};file=${encodeURIComponent(thumbnail)};size=80x80>;crop=on' alt="${title}" />
<img src='%SCRIPTURLPATH{"rest"}%/ImagePlugin/resize?topic=${web}.${topic};file=${encodeURIComponent(thumbnail)};size=80x80>;crop=on' alt="${title}" />
</div>
{{/if}}
<div class='foswikiTopicInfo' style='margin:0.5em 0'>
Expand Down
26 changes: 14 additions & 12 deletions 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"}%

Expand Down Expand Up @@ -58,14 +58,11 @@ This TopicFunction displays a collection of BlogEntries within the given CATegor
format="<div class='blogEntry'>
<div class='foswikiTopicInfo'>
<h2>
$percntMETACOMMENTS{
topic=\"$web.$topic\"
approval=\"on\"
format=\"<div class='blogCommentCount foswikiRight'>$dollarcount</div>\"
limit=\"1\"
singular=\"1\"
plural=\"$dollarcount\"
}$percnt<!-- -->
<div class='blogCommentCount foswikiRight'>
$percntDBCALL{\"Applications.BlogApp.RenderNumberOfComments\"
THETOPIC=\"$web.$topic\"
COMMENTSYSTEM=\"%COMMENTSYSTEM{default="metacomment"}%\"
}$percnt</div>
[[$web.$topic]]
$percntIF{\"'$expand(State)' = 'unpublished'\"
then=\"<span class='foswikiAlert foswikiSmall'>(%MAKETEXT{"unpublished"}%)</span>\"
Expand All @@ -74,7 +71,12 @@ This TopicFunction displays a collection of BlogEntries within the given CATegor
<div class='foswikiTopicSummary'>$expand(Summary')</div>
</h2>
<nop>$formatTime(createdate, '$day $mon $year')
&#124; [[%USERSWEB%.$expand(createauthor)][$expand(createauthor)]]
&#124; $percntFORMATLIST{
\"$expand(Author or createauthor)\"
split=\"\s*,\s*\"
format=\"$dollarpercntIF{\\"istopic '%USERSWEB%.$1'\\" then=\\"[[%USERSWEB%.$1]]\\" else=\\"<nop>$1\\"}$dollarpercnt\"
separator=\", \"
}$percnt
$percntCATINFO{
topic=\"$web.$topic\"
header=\"&#124; \"
Expand Down Expand Up @@ -116,10 +118,10 @@ $percntDBCALL{\"$web.$topic\"}$percnt <span class='blogMore'>&#8230;&nbsp;[[$web
<table class='foswikiNullTable' width='100%'>
<tr>
<td class='blogPrev'>
<a %IF{"%SKIP% = 0" then="style='display:none'"}%' href='%SCRIPTURL{"view"}%/%BASEWEB%/%BASETOPIC%?skip=%CALC{"$GET(thePrevSkip)"}%;limit=%LIMIT%%IF{"defined PARAMS" then="%PARAMS%"}%'>&#171;&nbsp;%MAKETEXT{"previous page"}%</a>
<a %IF{"%SKIP% = 0" then="style='display:none'"}%' href='%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?skip=%CALC{"$GET(thePrevSkip)"}%;limit=%LIMIT%%IF{"defined PARAMS" then="%PARAMS%"}%'>&#171;&nbsp;%MAKETEXT{"previous page"}%</a>
</td>
<td class='blogNext' align='right'>
<a %IF{"%CALC{"$GET(theNextSkip)"}% >= %COUNT%" then="style='display:none'"}% href='%SCRIPTURL{"view"}%/%BASEWEB%/%BASETOPIC%?skip=%CALC{"$GET(theNextSkip)"}%;limit=%LIMIT%%IF{"defined PARAMS" then="%PARAMS%"}%'>%MAKETEXT{"next page"}%&nbsp;&#187;</a>
<a %IF{"%CALC{"$GET(theNextSkip)"}% >= %COUNT%" then="style='display:none'"}% href='%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?skip=%CALC{"$GET(theNextSkip)"}%;limit=%LIMIT%%IF{"defined PARAMS" then="%PARAMS%"}%'>%MAKETEXT{"next page"}%&nbsp;&#187;</a>
</td>
</tr>
</table>
Expand Down
4 changes: 2 additions & 2 deletions 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"}%

Expand All @@ -21,7 +21,7 @@
hidenull="on"
depth="2"
filter="TopicType=~'\bBlogEntry\b' AND State != 'unpublished'"
header="<div class='blogSideBarSection'>
header="<div class='blogSideBarSection blogCategories'>
<h2 >%IF{"defined CAT and '%CAT%' !='' and '%CAT%' != 'TopCategory'"
then="%MAKETEXT{"[_1] categories" args="%CATINFO{cat="%CAT%" format="$title"}%"}%"
else="%MAKETEXT{"Categories"}%"
Expand Down
55 changes: 55 additions & 0 deletions 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
<verbatim class="tml">
%STARTINCLUDE%%DBCALL{
"Applications.BlogApp.RenderNumberOfComments"
section="%COMMENTSYSTEM{default="metacomment"}%"
   THETOPIC="%THETOPIC{default="%BASEWEB%.%BASETOPIC%"}%"
warn="off"
}%%STOPINCLUDE%
</verbatim>
---+++ metacomment
<verbatim class="tml">
%STARTSECTION{"metacomment"}%%METACOMMENTS{
topic="$web.$topic"
approval="on"
format="$count"
limit="1"
singular="1"
plural="$count"
}%%ENDSECTION{"metacomment"}%
</verbatim>

---+++ disqus
<verbatim class="tml">
%STARTSECTION{"disqus"}%%DISQUS_COUNT{"%THETOPIC%"}%%ENDSECTION{"disqus"}%
</verbatim>

---++ Test
%DBCALL{"%TOPIC%"}%

%DBCALL{"Applications.RenderFunctionCallers"}%

---++ Copyright
&copy; 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="<nop>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"}%
10 changes: 3 additions & 7 deletions data/_BlogTemplate/WebRss.txt
@@ -1,8 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1231502400" format="1.0" version="$Rev: 9914 $"}%
<channel rdf:about="%SCRIPTURL{"view"}%/%WEB%">
%IF{ "$'URLPARAM{search}'!=''" then="<title><nop>%WIKITOOLNAME% search results for <nop>%URLPARAM{search}%</title>" else="<title><nop>%WIKITOOLNAME%'s <nop>%WEB% web</title>"}%
<link>%SCRIPTURL{"view"}%/%WEB%</link>
<description>%MAKETEXT{"The [_1] web of Foswiki, the Free and Open Source Wiki." args="<nop>%WEB%"}%</description>
%INCLUDE{"%SYSTEMWEB%.WebRssBase"}%<!--
* Set SKIN = rss
-->
* Set VIEW_TEMPLATE = Applications.RssView
* Set FILTER = TopicType=~'\bBlogEntry\b'
* Set LIMIT = 5
10 changes: 9 additions & 1 deletion data/_BlogTemplate/WebTopicEditTemplate.txt
@@ -1,10 +1,18 @@
%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"}%
%META:FIELD{name="TopicTitle" attributes="" title="<nop>TopicTitle" value=""}%
%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"}%
5 changes: 4 additions & 1 deletion lib/Foswiki/Plugins/BlogPlugin/MANIFEST
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0cf03c6

Please sign in to comment.