DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Elmar’s FAQ

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2007-07-07T01:12:43
Author:Elmar Hinz
Email:elmar.hinz@team-red.net
Info 3:
Info 4:

EXT: Elmar’s FAQ

Extension Key: efaq

Copyright 2007-2007, Elmar Hinz, <elmar.hinz@team-red.net>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: eFAQ 1

Keywords 1

Abstract 1

Introduction 2

Achived features 2

Roadmap of features 3

Screenshots 4

Installation 9

Overview 9

Simple FAQ 9

Dynamic Simple FAQ 9

Classical FAQ 9

Regular FAQ 10

Dynamic Regular FAQ 10

Text Search 10

Administration 10

Adding user defined translations 10

Adding user defined fields 10

The sources of the templates 10

Addons 12

FAQ 13

Known Problems 13

TODO 13

ChangeLog 13

Keywords

  • Frequently asked questions (FAQ)
  • Model view controlller (MVC)
  • lib/div
  • jQuery (DHTML)
  • xajax (AJAX)
  • accessibility
  • XHTML

Abstract

The Elmar’s FAQis a TYPO3 extension to edit and to display questions and answers. Technically it is founded upon the modern MVC library lib/div. Depending on the state of the project, it will offer everything between a single list of questions and answers up to a multifunctional FAQ server.

The Elmar’s FAQproject is the dynamic process of this software development. People are invited to join in the project. The first principle is, that the project will provide a usefull product in every state. The second principle is that questions and answers are the leading patterns even if they will overlap with newsfeeds, forums, wikis and blogs while the project is advancing.

Introduction

The Elmar’s FAQproject is a work in progress. It provides you in every phase of it's proceeding with a valuable extension to maintain FAQ. And the range of features is growing. See below which features are already at your service and have a look into the roadmap to find out what s additionally planned.

As soon as the basics are standing, I will define a sytem for user contributed addon extensions, that can be incorporated into this basic FAQ extension quickly, as soon as they prove to be of use and quality. That will be the way to join in.

In comparism to the old tslib_pibase based FAQ extensions the modern lib/div based FAQ has multiple advantages. For example:

Adding userdefined fields is extremely easy. Just add new fields to the table by the kickstarter and call them with the provided functions in the Templates.

Adding translations is as simple. Define the translation in the locallang files. Use them directly in the template.

Due to the clean separation of the components it is comparingly simple to add new features, wich will soon be to your service.

If you are a developer it's possible to add your own features in a clean way without the need to hack the extension or using XCLASS.

As soon as people start to use the planned system of user contributed addons, the amount of features will get an additional push.

For more informations about the flexibility the new MVC architecture see:

< http://typo3.org/extensions/repository/view/lib/0.0.13/info/?tx_terfe_pi1%5BdownloadFile%5D=doc%252Flib-div-slideshow.pdf&cHash=1089a49c64 >If this complex link will be broken for any reason, here is the filelist:

http://typo3.org/extensions/repository/view/lib/0.0.13/ Achived features ^^^^^^^^^^^^^^^^

PHP Templates

Elmar’s FAQworks with the powerfull PHP template system, which gives you the maximal freedom to design and controll the output of the extension.

Simple FAQ

An ordered list of questions with the answer directly below each question.

Dynamic Simple FAQ

Like "Simple FAQ" but the answers are dynamically unfolded on click onto the question. A second click hides the answer again. Fallback to Simple FAQ behaviour if JavaScript is disabled.

Classical FAQ

This is the classical presentation of a FAQ on a single page. The questions are a list on top while the answers are a list below. You can navigate between questions and answers by links.

Regular FAQ

One page for the list of questions and an own page to display the answer. This is especially usefull for FAQ with long answers or those with user added fields.

Dynamic Regular FAQ

Much like Regular FAQ, but the Single answer replaces the list of questions and vice versa by ajax technology, without reloading the whole page. Falls back to Regular FAQ behaviour if JavaScript is disabled.

Installation

HINT: Currently the extension is developed for UTF-8 setups.
With other encodings it may not produce the expected results. Other encodings may be supported in future releases.

Install the extension with the extension manager.

Create a sysfolder to store the FAQ entries

In this folder create some entries.

Create the page(s) where the FAQ will be shown.

Insert as many content elements as necessary. Each time select the plugin Elmar’s FAQand choose the appropriate sub-plugin.

Select the FAQ storage folder in the flexform.

Make specific settings for the view you have choosen.

Include the static templateElmar’s FAQ.

Clear the cache and visit the result in the frontend.

Insert one plugin. The sub-plugin is Simple FAQ.

Insert one plugin. The sub-plugin is Dynamic Simple FAQ. This feature depends on the extension jQuery(jquery).

Insert two plugins Classical FAQ Questionsand Classical FAQ Answers.

Create two pages, one for the questions and one for the answers. The sub-plugins are Regular FAQ questionsand Regular FAQ answer.

Just like Regular FAQ, but the sub-plugins have the names Dynamic Regular FAQ questionsand Dynamic Regular FAQ answer. The single page is required as fallback solution to the Regular FAQbehaviour, if javascript is disabled. This feature depends on the extension xaJax(xajax).

Place the sub-plugin Text Searchabove one of the list of questions you have selected.

Administration

You can add as many translation markers as you like in the form of %%%xyz%%%. Logically you need to define the translations in the typical locations of TS or locallang files.

Build an extension with the kickstarterand choose to extend an existing table. Your fields extend the table tx_efaq_faqs. Add simple content fields like RTE, text, email, integer, date, money. In your PHP template you can print them with the appropriate printer functions (printAsRte(), printAsText, printAsFloat, ...). Please see the manual with the extension key libfor details.

Here we display the templates. If you have already some experience with PHP it is obvious for you how to adapt the templates to your needs. If not we recomment the tutorial for template developers included in the manual of the extension lib.

simpleFaqs.php

<?php $entryList = $this->get('entryList'); ?>

<?php if($entryList->isNotEmpty()): ?>
<ol class="faq">
<?php endif; ?>

<?php for($entryList->rewind(); $entryList->valid(); $entryList->next()): $entry = $entryList->current();?>

<li>
<h3><?php $entry->printAsHtml('question'); ?></h3>
<?php if($entry->has('author')): ?>
<p>%%%by%%%
<strong> <?php $entry->printAsEmail('email', 'author'); ?> </strong>
<em> <?php $entry->printAsUrl('url'); ?> </em>
</p>
<?php endif; ?>
<div><?php $entry->printAsRte('answer'); ?></div>
</li>

<?php endfor; ?>

<?php if($entryList->isNotEmpty()): ?>
</ol>
<?php endif; ?>

dynamicSimpleFaqs.php

<script type="text/javascript">
// <![CDATA[
$(document).ready(function(){
$("ol.faq > li > div").hide();
$("ol.faq > li > h3").toggle( function(){
$(this).parent().children("div").show("medium");
}, function(){
$(this).parent().children("div").hide();
}
);
});
// ]]>
</script>

<?php $entryList = $this->get('entryList'); ?>

<?php if($entryList->isNotEmpty()): ?>
<ol class="faq">
<?php endif; ?>

<?php for($entryList->rewind(); $entryList->valid(); $entryList->next()): $entry = $entryList->current();?>

<li>
<h3><a href="#"><?php $entry->printAsHtml('question'); ?></a></h3>
<?php if($entry->has('author')): ?>
<p>%%%by%%%
<strong> <?php $entry->printAsEmail('email', 'author'); ?> </strong>
<em> <?php print $entry->printAsUrl('url'); ?> </em>
</p>
<?php endif; ?>
<div><?php $entry->printAsRte('answer'); ?></div>
</li>

<?php endfor; ?>

<?php if($entryList->isNotEmpty()): ?>
</ol>
<?php endif; ?>

classicalFaqQuestions.php

<?php if (!defined ('TYPO3_MODE')) die ('Access denied.'); ?>
<?php $entryList = $this->get('entryList'); ?>

<?php if($entryList->isNotEmpty()): ?>
<ol class="questions">
<?php endif; ?>

<?php for($entryList->rewind(); $entryList->valid(); $entryList->next()): $entry = $entryList->current();?>
<li> <?php $entry->printLinkedQuestionTitle(); ?> </li>
<?php endfor; ?>

<?php if($entryList->isNotEmpty()): ?>
</ol>
<?php endif; ?>

classicalFaqAnswers.php

<?php if (!defined ('TYPO3_MODE')) die ('Access denied.'); ?>

<?php $entryList = $this->get('entryList'); ?>

<?php if($entryList->isNotEmpty()): ?>
<ol class="answers">
<?php endif; ?>
<?php for($entryList->rewind(); $entryList->valid(); $entryList->next()): $entry = $entryList->current();?>
<li>
<h3><?php $entry->printLinkedAnswerTitle(); ?></h3>
<?php if($entry->has('author')): ?>
<p>%%%by%%%
<strong> <?php $entry->printAsEmail('email', 'author'); ?> </strong>
<em> <?php print $entry->printAsUrl('url'); ?> </em>
</p>
<?php endif; ?>
<div><?php $entry->printAsRte('answer'); ?></div>
<p><?php $entry->printUpLink('%%%up%%%'); ?></p>
</li>
<?php endfor; ?>
<?php if($entryList->isNotEmpty()): ?>
</ol>
<?php endif; ?>

regularFaqQuestions.php

<?php $entryList = $this->get('entryList'); ?>

<?php if($entryList->isNotEmpty()): ?>
<ol class="questions">
<?php endif; ?>

<?php for($entryList->rewind(); $entryList->valid(); $entryList->next()): $entry = $entryList->current();?>
<li> <?php $entry->printLinkedQuestionTitle(); ?> </li>
<?php endfor; ?>

<?php if($entryList->isNotEmpty()): ?>
</ol>
<?php endif; ?>

regularFaqAnswer.php

<p class="backlink"><?php $this->printBacklink('%%%back%%%'); ?></p>
<h3><?php $this->printAsHtml('question'); ?></h3>
<?php if($this->has('author')): ?>
<p>%%%by%%%
<strong> <?php $this->printAsEmail('email', 'author'); ?> </strong>
<em> <?php print $this->printAsUrl('url'); ?> </em>
</p>
<?php endif; ?>
<div><?php $this->printAsRte('answer'); ?></div>
<p class="backlink"><?php $this->printBacklink('%%%back%%%'); ?></p>

dynamicRegularFaqQuestions.php

<?php $entryList = $this->get('entryList'); ?>

<?php if($entryList->isNotEmpty()): ?>
<ol class="questions">
<?php endif; ?>

<?php for($entryList->rewind(); $entryList->valid(); $entryList->next()): $entry = $entryList->current();?>
<li> <?php $entry->printLinkedQuestionTitle(); ?> </li>
<?php endfor; ?>

<?php if($entryList->isNotEmpty()): ?>
</ol>
<?php endif; ?>

dynamicRegularFaqAnswer.php

<p class="backlink"><?php $this->printBacklink('%%%back%%%'); ?></p>
<h3><?php $this->printAsHtml('question'); ?></h3>
<?php if($this->has('author')): ?>
<p>%%%by%%%
<strong><?php $this->printAsEmail('email', 'author'); ?></strong>
<em> <?php print $this->printAsUrl('url'); ?> </em>
</p>
<?php endif; ?>
<div><?php $this->printAsRte('answer'); ?></div>
<p class="backlink"><?php $this->printBacklink('%%%back%%%'); ?></p>

To adapt the templates please copy the whole template directory into another location that is accessible for the server but not for other users like the editors. Set the TS setup plugin.tx_efaq.configuration.phpTemplatePathto the new location.

Addons

Addons to Elmar’s FAQare independent extensions. Addons should be done in a way, that it will be possible to also incorporate into the Elmar’s FAQextension as new features by simply copying the files into. We will reflect how namings should be handled that this is possible without a lot of renaming.

FAQ

FAQs about the FAQ.

Known Problems

It has been developed and tested with utf-8 only. Problems may occur with other encodings.

TODO

  • Some refinements and configurations of the text search
  • Implementing the storage folder selection into the query.
  • Configuration for non utf-8 for xajax.

ChangeLog

07-01-11 Elmar Hinz  <elmar.hinz@team-red.net>

* release 0.1.3
* implementation of the text search

07-01-11 Elmar Hinz  <elmar.hinz@team-red.net>

* release 0.1.2
* synchronization with alterations of lib

07-01-11 Elmar Hinz  <elmar.hinz@team-red.net>

* release 0.1.1
* featuture: Dynamic Regular FAQ

07-01-08 Elmar Hinz  <elmar.hinz@team-red.net>

* release 0.1.0
* feature: Regular FAQ
* documentation: update
  * status change: beta

07-01-05 Elmar Hinz  <elmar.hinz@team-red.net>

* release 0.0.5
* documentation update

07-01-05 Elmar Hinz  <elmar.hinz@team-red.net>

* release 0.0.4
* feature: Simple FAQ
* feature: Dynamic Simple FAQ

07-01-03 Elmar Hinz  <elmar.hinz@team-red.net>

* release 0.0.3
* more documentations

07-01-02 Elmar Hinz  <elmar.hinz@team-red.net>

* release 0.0.2
* first documentations

06-12-29 Elmar Hinz  <elmar.hinz@team-red.net>

* release 0.0.1
 * feature: Classical FAQ

img-11 EXT: Elmar’s FAQ - 14