This page is still a beta!

1.5. Administration

Adding user defined translations

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.

.. TODO: Name the locations where to do store userdefined tranlations.

Adding user defined fields

.. TODO: Name the locations where to do store userdefined tranlations.

Build an extension with the kickstarter and 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 lib for details.

The sources of the templates

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="/extension-manuals/efaq/0.1.3/view/1/5/#"><?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.phpTemplatePath to the new location.