Blog It-Core Template
Control Panel
(:if false:)[[#control-panel]](:ifend:) (:blogid:{$bi_BlogList_BLOG1}:) * [[{$bi_Admin}?action=blogitadmin&s=unapproved-comments&blogid={(bi_ifnull "{$$blogid}" {$:blogid})} | Unapproved Comments: (:includesection "#comments-count-pagelist commentstatus=false blogid={(bi_ifnull "{$$blogid}" {$:blogid})}":)]] * [[{$bi_NewEntry} | New Entry]] * [[{$bi_Admin}?action=blogitadmin&s=blog-grid&blogid={(bi_ifnull "{$$blogid}" {$:blogid})}&status={$bi_StatusType_DRAFT} | Drafts]] * [[{$bi_Admin}?action=blogitadmin&s=blog-grid&blogid={(bi_ifnull "{$$blogid}" {$:blogid})}&status={$bi_StatusType_PUBLISH} | Published]] * [[{$bi_Admin}?action=blogitadmin&s=blog-grid&blogid={(bi_ifnull "{$$blogid}" {$:blogid})}&status={$bi_StatusType_STICKY} | Stickies]] (:if !equal "{$bi_StatAction}" "" :)* [[{*$FullName}?action={$bi_StatAction} | Statistics]](:if:) * [[{*$FullName}?action=logout | logout]] [[#control-panelend]]
LAYOUT TEMPLATES
These will typically be over-ridden by skins in order to change layout.
Blogs
#common-blog-head
Parameters: listformat (show header or not), entrydate, entrytags, fullname, entryauthor, showcount
(:if false:)[[#common-blog-head]](:ifend:) (:if equal "{$$listformat}" "true":)!! [[{$$fullname}|{$$title}]](:ifend:) (:div9991 class="blogit-meta-data":)\ (:if !equal "{$$entryauthor}" "":)By (:if exists {$bi_AuthorGroup}.{$$entryauthor}:)[[{$bi_AuthorGroup}/{$$entryauthor}]](:else:){$$entryauthor}(:ifend:)(:ifend:)\ (:if !equal "{$$entrydate}" "":)(:if !equal "{$$entryauthor}" "":), on (:ifend:)%blogit-date%{(ftime fmt="{$bi_DateDisplayFormat}" when=@{$$entrydate})}%%(:ifend:) \ (:if !equal "{$$entrytags}" "":) | $[Filed under]: %blogit-tags%(:blogit tags:){$$entrytags}(:blogitend:)%%(:ifend:) \ (:if auth edit:)%blogit-edit-link%%item accesskey="$[ak_edit]"% | [[{$$fullname}?action=blogitedit | $[(edit)]]]%%(:ifend:) (:div9991end:) [[#common-blog-headend]]
#single-entry-view
(:if false:)[[#single-entry-view]](:ifend:) (:div9990 class="blogit-post":)(:includesection "#common-blog-head fullname={*$FullName} title={*$Title} entrydate={*$:entrydate} entrytags='{*$:entrytags}' entryauthor='{*$:entryauthor}' listformat=false entrytags='{*$:entrytags}' ":) (:div9991 class="blogit-post-body":) {*$:entrybody} (:div9991end:) (:div9990end:) (:includesection "#comments-pagelist pagename={*$Name} group={*$Group} entrycomments={*$:entrycomments} divid=commentblock":) [[#single-entry-viewend]]
#multi-entry-view
Parameters: pagenav?, perpage?
(:if false:)[[#multi-entry-view]](:ifend:) (:template defaults order=-$:entrydate:) (:template each:) (:div9990 class="blogit-post-summary":)(:includesection "#common-blog-head fullname={=$FullName} title={=$Title} entrydate={=$:entrydate} entrytags='{=$:entrytags}' entryauthor='{=$:entryauthor}' listformat=true entrytags='{*$:entrytags}' ":) (:div9991 class="blogit-post-intro":) (:blogit intro:){=$:entrybody}(:blogitend:) (:div9991end:) (:div9991 class="blogit-post-footer":)%blogit-more%(:blogit more {=$FullName}:){=$:entrybody}(:blogitend:)%% (:div9991end:) (:div9990end:) (:template last:) (:includesection "#page-navigation itemsonpage={$$PageCount} pagenav={$$pagenav} perpage={$$perpage}":) [[#multi-entry-viewend]]
#blog-list-view
Parameters: pagenav, perpage
(:if false:)[[#blog-list-view]](:ifend:) (:template defaults wrap=inline:) (:template first:) (:div class="blogit-blog-list":) (:table class="blog-list":) (:cellnr class="blogit-blog-list-header":)$[Actions] (:cell:)$[Title] (:cell:)$[Author] (:cell:)$[Date] (:cell:)$[Tags] (:template first {=$:entrystatus}:) (:cellnr class="blog-list-header" colspan=5:)'''{=$:entrystatus}''' (:template each:) (:cellnr class="blogit-edit-link":)(:if auth edit:)[[{=$FullName}?action=blogitedit | edit]](:ifend:) (:cell class="blogit-title":)[[{=$FullName}|{=$Title}]] (:cell class="blogit-author":)(:if !equal "{=$:entryauthor}" "":)(:if exists {$bi_AuthorGroup}.{=$:entryauthor}:)[[{$bi_AuthorGroup}/{=$:entryauthor}]](:else:){=$:entryauthor}(:ifend:)(:ifend:) (:cell class="blogit-date":){(ftime fmt="{$bi_DateDisplayFormat}" when=@{=$:entrydate} )} (:cell class="blogit-tags":){=$:entrytags} (:cell class="blogit-commentcount":)\ (:includesection "#comments-count-pagelist entrygroup='{=$Group}' entryname='{=$Name}' commentstatus=true" :)/(:includesection "#comments-count-pagelist entrygroup='{=$Group}' entryname='{=$Name}' commentstatus=false":) (:template last:) (:tableend:) (:includesection "#page-navigation itemsonpage={$$PageCount} pagenav={$$pagenav} perpage={$$perpage}":) (:divend:) [[#blog-list-viewend]]
#blog-summary-list
Simple bullet list of blog titles.
Parameters: more
(:if false:)[[#blog-summary-list]](:ifend:) (:template each:) * %apply list class="blogit-blog-summary-list"%[[{=$FullName} | {=$Title}]]%% (:template last:) (:if !equal {$$more} false:)(:div style="text-align:right":)[[Site.BlogList | $[more]...]] (:divend:)(:ifend:) [[#blog-summary-list]]
Comments
#comment-view
(:if false:)[[#comment-view]](:ifend:) (:template first:) (:if equal {$$onlyunapproved} false:) !! $[Comments] (:ifend:) (:div9990 class="blogit-commentblock":) (:template each:) (:if [ equal {$$onlyunapproved} "true" && !equal {(bi_base {=$FullName})} {(bi_base {<$FullName})} ]:) !!! [[{(bi_base {=$FullName})} | {{(bi_base {=$FullName})}$Title}]](:ifend:) * %apply list class="blogit-comment-list"%[[#T{=$:commentdate}]]By (:if equal "{$bi_LinkToCommentSite}" "true":)%rel=nofollow%[[{=$:website} | {=$:commentauthor}]]%%(:else:){=$:commentauthor}(:ifend:), on %blogit-comment-timestamp%{(ftime fmt="{$bi_DateDisplayFormat}" when=@{=$:commentdate})}%% \ (:if [ auth admin && equal {=$:commentapproved} false ] :)\ [[{*$FullName}?action=blogitapprove&pn={=$FullName} | $[approve]]] | (:ifend:)\ (:if auth admin:)[[{=$FullName}?action=edit | $[edit]]](:ifend:)\\ (:blogit multiline:){=$:commenttext}(:blogitend:) (:template last:) (:div9990end:) [[#comment-viewend]]
#comment-summary-list
Parameter: datestamp (true/false)
(:if false:)[[#comment-summary-list]](:ifend:) * %apply list class="blogit-comment-summary-list"%[[{(bi_base {=$FullName})}#T{=$:commentdate} | (:blogit substr 0 60:){=$:commenttext}(:blogitend:)...]]%% (:if equal {$$datestamp} true:)%blogit-comment-timestamp%{(ftime fmt="{$bi_DateEntryFormat}" when=@{=$:commentdate})}%%(:ifend:) [[#comment-summary-listend]]
Forms
#blog-form
(:if false:)[[#blog-form]](:ifend:) (:messages:) $[Blog Title]: (:input text $:entrytitle size=70 class="blogit-title" id="entrytitle":)\ (:blogit list "$:entrytype":)bi_PageType/$[Type]: (:blogitend:)[==]\ (:blogit list "$:blogid":)bi_BlogList/$[BlogID]: (:blogitend:)\\ $[Tags]: (:input text $:entrytags size=20 id="entrytags":)\ (:blogit list "$:entrystatus":)bi_StatusType/$[Status]: (:blogitend:)\ (:if equal "{$bi_CommentsEnabled}" true:)[==](:blogit list "$:entrycomments":)bi_CommentType/$[Comments]: (:blogitend:)\ (:else:)(:input hidden $:entrycomments "$bi_CommentType_NONE":)(:ifend:)\\\ (:e_guibuttons:)\\ (:input textarea $:entrybody rows=23 cols=80 id="text":)\ $[Pagename (Group.Name)]: (:input text $:entryurl size=70 id="entryurl":)\\ $[Author]: (:input text $:entryauthor size=25 id="entryauthor":)\ $[Date]: (:input text $:entrydate size=15 id="entrydate" value=(:if !equal "{$bi_Default_ptv_entrydate}" "":)"{$bi_Default_ptv_entrydate}"(:else:)"{(ftime fmt='{$bi_DateEntryFormat}' @(bi_ifnull {*$:entrydate} {$Now}) )}"(:if:) :)\\ (:input submit value="$[Save]" accesskey="s" id="blogit-save":) [[#blog-formend]]
#comment-form
(:if false:)[[#comment-form]](:ifend:) !! $[Leave a comment] (:messages:) '''$[Name]''' $[(required)]:\\ (:input text $:commentauthor id="comment-author":)\\ '''$[E-mail]''' $[(required, will not be published)]:\\ (:input text $:email id="comment-email":)\\ $[Website]:\\ (:input text $:website id="comment-website":)\\ (:input textarea $:commenttext rows=10 cols=50 id="comment-text":)\\ (:if equal {$EnablePostCaptchaRequired} 1:)Enter value: {$Captcha} (:input captcha:) (:ifend:)\ (:input submit name=post value="$[Post]" id="comment-post":) [[#comment-formend]]
General
#no-results-found
(:if false:)[[#no-results-found]](:ifend:) !! No more pages found Click [[{*$FullName} | here to return to first page]]. [[#no-results-foundend]]
#page-navigation
Parameters: itemsonpage (entries on this particular page set), pagenav? (show page nav links?), perpage? (override entries-per-page)
(:if false:)[[#page-navigation]](:ifend:) (:if !equal "{$$pagenav}" false:)(:div class="page-navigation":)\ (:if !equal "{$bi_PagePrev}" "":)\ %previous-entries%[[{(bi_url {*$FullName} page {$bi_PagePrev})} | $[newer posts]]]\ (:ifend:)\ (:if equal {earlymx(bi_lt "{$$itemsonpage}" (bi_ifnull "{$$perpage}" "{$bi_EntriesPerPage}"))} false:)\ %next-entries%[[{(bi_url {*$FullName} page {$bi_PageNext})} | $[older posts]]]\ (:ifend:) (:divend:) (:ifend:) [[#page-navigationend]]
PAGELISTS
#tag-pagelist
(:if false:)[[#tag-pagelist]](:ifend:) (:pagelist list="blogit" fmt=#titlespaced link={$bi_CategoryGroup}.{*$Name}:) [[#tag-pagelistend]]
#tag-list-pagelist
Parameters: count
(:if false:)[[#tag-list-pagelist]](:ifend:) (:pagelist wrap=none fmt=#titlespaced group={$bi_CategoryGroup}:) [[#tag-list-pagelistend]]
Blogs Pagelists
#blog-summary-pagelist
Parameters: blogid, status, pagenav (true/false -- default is true), count (0 for default all; null for default defined in config), daterange
(:if false:)[[#blog-summary-pagelist]](:ifend:) (:pagelist list="blogit" wrap=none fmt=#multi-entry-view\ order=-$:entrydate\ $:entrytype={$bi_PageType_BLOG}\ {(bi_param group "{$bi_BlogGroups}")}\ {(bi_param $:blogid "{$$blogid}")}\ {(bi_param $:entrystatus "{$$status}")}\ {(bi_param link "{$$link}")}\ {(bi_param perpage "{$$count}")}\ if='{(bi_cond date "{$$daterange}" "@{=$:entrydate}")}'\ (:if !equal {$$count} 0:){(bi_param pagenav "{$$pagenav}")}\ count={(bi_ifnull {$$count} "{$bi_EntryStart}..{$bi_EntryEnd}")}(:ifend:)\ :) [[#blog-summary-pagelistend]]
#blog-summary-list-pagelist
Parameters: blogid, count, status, more (include more link)
(:if false:)[[#blog-summary-list-pagelist]](:ifend:) (:pagelist list="blogit" wrap=none fmt=#blog-summary-list count={$$count}\ order=-$:entrydate\ $:entrytype={$bi_PageType_BLOG}\ {(bi_param group "{$bi_BlogGroups}")}\ {(bi_param $:blogid "{$$blogid}")}\ {(bi_param $:entrystatus "{$$status}")}\ more={$$more}\ :) [[#blog-summary-list-pagelistend]]
#blog-grid
Accepts parameters of status, count (really perpage), blogid, pagenav
(bi_param pagenav {$$pagenav}) count=(bi_ifnull {$$count} ..)
(:if false:)[[#blog-grid]](:ifend:) (:pagelist list="blogit" wrap=none fmt=#blog-list-view \ order=$:entrystatus,-$:entrydate\ $:entrytype={$bi_PageType_BLOG}\ {(bi_param group "{$bi_BlogGroups}")}\ {(bi_param $:blogid "{$$blogid}")}\ {(bi_param $:entrystatus "{$$status}")}\ {(bi_param perpage "{$$count}")}\ (:if equal "{$$count}" "0":)pagenav=false\ (:else:){(bi_param pagenav "{$$pagenav}")}\ count={$bi_EntryStart}..{$bi_EntryEnd}\ (:ifend:)\ :) [[#blog-gridend]]
Comments Pagelists
#comments-pagelist
Parameters: pagename, group, entrycomments, divid
(:if false:)[[#comments-pagelist]](:ifend:) (:if !equal {$$entrycomments} "{$bi_CommentType_NONE}":) (:div9970 id="{$$divid}":)\ (:pagelist wrap=none fmt=#comment-view\ order=ctime\ group="{$bi_CommentGroup}"\ name={$$group}-{$$pagename}-* \ if="[ auth admin || equal {=$:commentapproved} true ]"\ onlyunapproved=false\ :)(:ifend:)\ (:if [ equal "{$$entrycomments}" "{$bi_CommentType_OPEN}" && equal {$bi_CommentsEnabled} true ] :)\ (:pmform {$bi_CommentForm}:)(:ifend:) (:div9970end:) [[#comments-pagelistend]]
#comment-summary-list-pagelist
Parameters: blogid, count
(:if false:)[[#comment-summary-list-pagelist]](:ifend:) (:pagelist wrap=none fmt=#comment-summary-list count={$$count}\ order=-ctime\ group="{$bi_CommentGroup}"\ {(bi_param $:blogid "{$$blogid}")}\ $:commentapproved=true\ :) [[#comment-summary-list-pagelistend]]
#unapproved-comments
Parameters: onlyunapproved (approval status: true/false), blogid
(:if false:)[[#unapproved-comments]](:ifend:) (:if [ auth admin && equal {$bi_CommentsEnabled} true ]:) (:pagelist wrap=none fmt=#comment-view\ order=name,-ctime\ group="{$bi_CommentGroup}"\ {(bi_param $:blogid "{$$blogid}")}\ $:commentapproved=false\ onlyunapproved=true\ :) (:ifend:) [[#unapproved-commentsend]]
#comments-count-pagelist
Parameters: commentstatus: true/false, entrygroup, entryname?, blogid?
(:if false:)[[#comments-count-pagelist]](:ifend:)\ (:if equal {$bi_CommentsEnabled} true:)\ (:pagelist wrap=none fmt=count \ group="{$bi_CommentGroup}"\ {(bi_param $:blogid "{$$blogid}")}\ (:if [ !equal "{(bi_ifnull {$$entrygroup} '')}" "" && !equal "{(bi_ifnull {$$entryname} '')}" "" ] :)name={$$entrygroup}-{$$entryname}-* (:if:)\ $:commentapproved={$$commentstatus}\ :)(:ifend:)\ [[#comments-count-pagelistend]]
CORE TEMPLATES
You probably don't want to be changing these as they determine how blogit functions, rather than having anything to do with layout.
Blogs
#blog-form-control
(:if false:)[[#blog-form-control]](:ifend:) (:div1 id="wikiedit":) (:input pmform target="{$bi_BlogForm}":)\ (:input default source="{*$FullName}" request=1:)\ (:input default $:entrystatus "{$bi_StatusType_DRAFT}":)\ (:input default $:entryauthor "{$Author}":)\ (:input default $:entrydate "{(ftime fmt='{$bi_DateEntryFormat}' @{$Now} )}":)\ (:input default $:entryurl "{(bi_default_url {*$FullName})}":)\\ (:includesection "#blog-form":) (:input end:) (:div1end:) (:include $[{$SiteGroup}/EditQuickReference]:) [[#blog-form-controlend]]
#blog-post-control
Note: Validation is performed here to trigger PmForms error, and stop processing. However, when the use enters an invalid date, it gets converted to a valid Unix timestamp, and thus the user sees a date, they didn't enter. So additional validation is performed in blogit.php. If the user enters an invalid date we pass pack the actual string they entered.
(:if false:)[[#blog-post-control]](:ifend:) (:template defaults saveto="{$$ptv_entryurl}":) (:template defaults successpage="{$$saveto}":) (:template require $:entrytitle errmsg="$[Title is required]":) (:template require $:entryurl errmsg="$[Pagename is required]":) (:template require $:entryurl if="!bi_ispage '{$$ptv_entryurl}'" errmsg="$[Pagename already exists, or is invalid/blank]":) (:template require $:entrydate if="bi_isdate {$$ptv_entrydate}" errmsg="$[Invalid date]":) (:template defaults savevars=$:pmmarkup,$:blogid,$:entrytype,$:entrydate,$:entryauthor,$:entrytitle,$:entrystatus,$:entrycomments,$:entrytags,$:entrybody:) [[#blog-post-controlend]]
#blog-edit
(:if false:)[[#blog-edit]](:ifend:) (:pmform {$bi_BlogForm}:) [[#blog-edit]]
Comments
#comment-form-control
(:if false:)[[#comment-form-control]](:ifend:) (:input pmform target="{$bi_CommentForm}":)\ (:input default request=1:)\ (:input default $:commentauthor "{$Author}":)\ (:input hidden $:blogid value="{*$:blogid}":)\ (:includesection "#comment-form":) (:input end:) [[#comment-form-controlend]]
#comment-post-control
(:if false:)[[#comment-post-control]](:ifend:) (:template require $:blogid errmsg="":) (:template require $:commentauthor errmsg="$[Name is required]":) (:template require $:email errmsg="$[Email is required]":) (:template require $:email if="bi_isemail {$$ptv_email}" errmsg="$[Email address is invalid.]":) (:template defaults savevars=$:blogid,$:entrytype,$:commentauthor,$:email,$:website,$:commenttext,$:commentapproved,$:commentdate:) [[#comment-post-controlend]]