What follows is the code used to render the list of FAQs above and is only visible to AdminGroup. It grabs all the FAQ's with one search (rather than repeating the search for each section) and then splits them up by subject area. This reduced the load time for the FAQ topic by about 2/3rds. -- LynnwoodBrown - 18 Apr 2015
Render Each FAQ Subject Area
Parameters:
- QUESTIONLIST - required - formatted hash of all topics with the selected status. See
grabQuestions
section below for info on how the individual topic data is structured.
%STARTSECTION{"subjects"}%
%FORMATLIST{"Installation, Setup, Security, Registration or Authentication or Authorisation, Editing, Templates, Email and Notifications, Search, Extension, Errors, Development, Debugging"
split=", "
separator=" $n"
format="$percntFORMATLIST{\"$percntQUESTIONLIST$percnt\"
split=\"##\"
pattern=\"(.*?)~(.*?)~(.*)\"
include=\".*?$1.*?~.*\"
null=\"\"
header=\"<div style='float:left;position:relative;top:1em;'><a href='#PageTop' title='Return to top'>$dollarpercntICON{arrowup}$dollarpercnt</a></div> $dollarn---++ $1
$dollarn\"
format=\" * [[$dollar2][$dollar3]]\"
separator=\"$dollarn\"
}$percnt"
}%
%ENDSECTION{"subjects"}%
This section grabs all
FAQs at one time. For each record, it renders a set of topic information separated by tildas (~) as follows: "formfield(Subject)~web.topic~formfield(TopicTitle)".
%STARTSECTION{"grabQuestions"}%%SEARCH{"TopicClassification='FrequentlyAskedQuestion'"
excludetopic="FaqTemplate"
web="%WEB%,%SYSTEMWEB%"
type="query"
format="$formfield(Subject)~$web.$topic~$percntENCODE{\"$formfield(TopicTitle)\" type=\"quote\"}$percnt"
nonoise="on"
separator="##"
}%%ENDSECTION{"grabQuestions"}%