Documentation
This
TopicFunction displays a collection of
BlogEntries within the given CATegory and/or TAG.
Parameters
- SKIP: offset into the archive
- LIMIT: number of postings to show at max
- CAT: categories to extract (optional)
- TAG: tagged entries to be extracted (optional)
- STICKY: a pattern the Sticky field must match to list the posting see the "Sticky" definition in Blog Entry (optional)
- NOSTICKY: same as STICKY but with inverse logic
- FROM_TIME: lower boundary of timespan to display in epoch seconds
- TO_TIME: uppwer boundary of timespan to display in epoch seconds
- ONLYTEASER: switch "on" to just render the teaser section; defaults to rendering the full posting
- THEWEB, defaults to BASEWEB
Implementation
%STARTINCLUDE%<noautolink>
%DBQUERY{
"TopicType=~'\bBlogEntry\b'
AND State='published'
AND topic!='WebTopicEditTemplate'
%IF{"'%FROM_TIME{default=""}%' != ''"
then=" AND publishdate >= '%FROM_TIME%'"
}%%IF{"'%TO_TIME{default=""}%' != ''"
then="AND publishdate < '%TO_TIME%'"
}%%IF{"'%CAT{default=""}%' != ''"
then=" AND topic ISA '%CAT%'"
}%%IF{"'%TAG{default=""}%' != ''"
then=" AND Tag=~'\b%TAG%\b'"
}%%IF{"'%STICKY{default=""}%' != ''"
then=" AND Sticky=~'\b%STICKY%\b'"
}%%IF{"'%NOSTICKY{default=""}%' != ''"
then=" AND !(Sticky=~'\b%NOSTICKY%\b')"
}% AND (preferences.CONTENT_LANGUAGE='%LANGUAGE%' OR ('%LANGUAGE%'='%DEFAULTLANGUAGE%' AND !preferences.CONTENT_LANGUAGE))"
limit="%LIMIT{default="5"}%"
skip="%SKIP{default="0"}%"
sort="publishdate"
reverse="on"
hidenull="on"
web="%THEWEB{default="%BASEWEB%"}%"
header="%IF{"'%STICKY{default=""}%' != ''" then="<div class='blogEntriesSticky'>"}%"
format="<div class='blogEntry'>
<div class='foswikiTopicInfo'>
<h1>
[[$web.$topic]]
$percntIF{\"'$expand(State)' != 'published'\"
then=\"<span class='foswikiAlert foswikiSmall'>($expand(State))</span>\"
}$percnt<!-- -->
$percntREDDOT{\"$web.$topic\"}$percnt<!-- -->
<div class='foswikiTopicSummary'>$expand(Summary')</div>
</h1>
%IF{"'%STICKY{default=""}%' = ''"
then="$percntDBCALL{\"%WEB%.%TOPIC%\" section=\"revinfo\"}$percnt"
}%<!-- -->
</div>
<div class='blogText hyphenate clearfix'>
$percntDBCALL{\"$web.$topic\"
$percntIF{\"'%ONLYTEASER{default="off"}%'='on' AND '$expand(_sections)'!=''\"
then=\"section=\\"teaser\\"\"
}$percnt
}$percnt
<div class='blogMore'>[[$percntIF{\"'$expand(TargetPage)'\" then=\"$expand(TargetPage)\" else=\"$web.$topic\"}$percnt][%TRANSLATE{"Read more"}%]]</div>
</div>
</div>"
footer="%IF{"'%STICKY{default=""}%' != ''" then="</div>"}%
$percntDBCALL{\"%WEB%.%TOPIC%\"
section=\"pagination%IF{"'%STICKY{default=""}%'!=''" then="DISABLED"}%\"
warn=\"off\"
LIMIT=\"%LIMIT{default="5"}%\"
SKIP=\"%SKIP{default="0"}%\"
COUNT=\"$count\"
CLASS=\"blogBottomPagination\"
PARAMS=\"%IF{
"'%STICKY{default=""}%'!=''" then="&sticky=%STICKY%"
}%%IF{
"'%CAT{default=""}%'!=''" then="&catname=%CAT%"
}%\"
}$percnt<!-- -->"
}%<!-- -->
</noautolink>%STOPINCLUDE%
Revinfo
%STARTSECTION{"revinfo"}%<div class='foswikiRevision'>%JQICON{"ma-calendar-month"}% <nop>$formatTime(publishdate)
<span class='foswikiRevisionSep'>|</span> %JQICON{"ma-person"}% $percntFORMATLIST{
\"$expand(Author or createauthor)\"
split=\"\s*,\s*\"
pattern=\"^(?:.*\.)?(.*?)$\"
format=\"$dollarpercntIF{\\"istopic '%USERSWEB%.$1'\\" then=\\"<a href='$dollarpercntSCRIPTURLPATH{\\"view\\" topic=\\"%USERSWEB%.$1\\"}$dollarpercnt' class='foswikiUserField' data-wiki-name='$1'>$dollarpercntGETTOPICTITLE{%USERSWEB%.$1}$dollarpercnt</a>\\" else=\\"<nop>$1\\"}$dollarpercnt\"
separator=\", \"
}$percnt
$percntIF{\"'$expand(total_likes)'>0\"
then=\"<span class='foswikiRevisionSep'>|</span> %JQICON{"ma-thumb-up"}% $expand(total_likes)\"
}$percnt $percntIF{\"'$expand(comment[])'!=''\"
then=\"<span class='foswikiRevisionSep'>|</span> %JQICON{"fa-comment"}% $expand(comment[])\"
}$percnt <!-- -->
$percntCATINFO{
topic=\"$web.$topic\"
exclude=\"TopCategory\"
header=\"<span class='foswikiRevisionSep'>|</span> %JQICON{"fa-folder"}% \"
}$percnt<!-- -->
$percntTAGINFO{
topic=\"$web.$topic\"
header=\"<span class='foswikiRevisionSep'>|</span> %JQICON{"fa-tag"}% \"
}$percnt</div>%ENDSECTION{"revinfo"}%
%STARTSECTION{"pagination"}%<!-- -->
%CALCULATE{
"$SET(theNextSkip,$EVAL($VALUE(%SKIP{default="0"}%)+$VALUE(%LIMIT{default="5"}%)))
$SET(thePrevSkip,$EVAL($VALUE(%SKIP{default="0"}%)-$VALUE(%LIMIT{default="5}%)))
$IF($GET(thePrevSkip) < 0,$SET(thePrevSkip,0))"
}%<!-- -->
<div class='clsPagination foswikiHideOnPrint'>
<a class='clsPaginationPrev' %IF{"%SKIP{default="0"}% = 0" then="style='visibility:hidden'"}% href='%SCRIPTURLPATH{"view" topic="%BASEWEB%.%BASETOPIC%"}%?%IF{"'%URLPARAM{"time"}%'!=''" then="time=%URLPARAM{"time"}%&"}%skip=%CALCULATE{"$GET(thePrevSkip)"}%&limit=%LIMIT{default="5"}%%PARAMS{default=""}%'>%TRANSLATE{"previous page"}%</a>
<a class='clsPaginationNext' %IF{"%CALCULATE{"$GET(theNextSkip)"}% >= %COUNT%" then="style='visibility:hidden'"}% href='%SCRIPTURLPATH{"view" topic="%BASEWEB%.%BASETOPIC%"}%?%IF{"'%URLPARAM{"time"}%'!=''" then="time=%URLPARAM{"time"}%&"}%skip=%CALCULATE{"$GET(theNextSkip)"}%&limit=%LIMIT{default="5"}%%PARAMS{default=""}%'>%TRANSLATE{"next page"}%</a>
</div><!-- -->%ENDSECTION{"pagination"}%
Test
no stickiness
Pellentesque fringilla scelerisque blandit! Vivamus quis rhoncus turpis. Nunc vestibulum purus at ipsum aliquam porta. Nullam lobortis, lacus sed porttitor viverra, nulla tellus iaculis ligula, eu vestibulum nunc lacus ac magna. Nulla feugiat cursus mattis. Mauris aliquam diam at sem mattis iaculis. Praesent ultricies, ipsum quis adipiscing fermentum, dui leo congue orci, a viverra nisi sem lobortis orci? Praesent ultrices magna ac ante auctor sit amet lobortis enim vehicula. Morbi tincidunt accumsan augue nec convallis! Sed blandit orci quis orci iaculis suscipit! Nam vulputate adipiscing sollicitudin. Morbi erat lectus, fermentum sit amet tristique in, euismod eu libero. Donec placerat ornare auctor. Donec non nisl ac ante adipiscing bibendum. Donec quam lectus, porta eu porta et, eleifend porta dui?
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse vulputate malesuada eros, sed ullamcorper odio ullamcorper at. Mauris tincidunt luctus nibh in blandit. Vestibulum nec vulputate mauris. Vestibulum cursus ligula a lacus molestie nec posuere mauris interdum. Nullam ut sollicitudin justo. Morbi egestas consequat quam, a molestie diam pharetra a. Vestibulum congue neque ut metus sollicitudin vitae pharetra ante tempus. Sed egestas accumsan felis vel feugiat. Duis non mi sed metus imperdiet luctus. Praesent vel ipsum id tellus sollicitudin volutpat sit amet interdum turpis. Maecenas a bibendum sem.
stickiness
Calls to 'RenderBlogEntries'
Copyright
© 2005-2025 Michael Daum
This file is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. For
more details read the
LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.