You are here: Foswiki>Support Web>FAQ (18 Apr 2015, LynnwoodBrown)Edit Attach

Frequently Asked Questions

arrowup

Installation

arrowup

Setup

arrowup

Security

arrowup

Registration or Authentication or Authorisation

arrowup

Editing

arrowup

Templates

arrowup

Email and Notifications

arrowup

arrowup

Extension

arrowup

Errors

arrowup

Development

arrowup

Debugging

arrowup

General

arrowup

Foswiki administration

arrowup

Developing extensions

pencil Create a new FAQ (Please only create new FAQ's for questions that have answers, and have been asked repeatedly)

see also System.FrequentlyAskedQuestions

IF{ "$USERNAME not ingroup 'AdminGroup'" then="foswikiHidden'" }: Missing operator in '$USERNAME not ingroup 'AdminGroup'' '>

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"}%

Get all FAQs

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"}%
Topic revision: r18 - 18 Apr 2015, LynnwoodBrown - This page was cached on 01 Sep 2015 - 03:08. Get a fresh version here.
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License