[TYPO3-project-formidable] Template file optional

Manuel Rego Casasnovas mrego at igalia.com
Thu Jan 8 20:34:50 CET 2009


Hello,

I'm defining a generic plugin in an extension that uses Formidable to
show a list of items and the detail of each one.

And I've configured the flexform plugin allowing to select a template
file or left the template file empty.

So the expected behaviour should be that if a template is set it should
be used, otherwise the default Formidable template will be used.

I'm wondering about how to do this, for example I have the next XML
configuration:
<template>
   <path>
      <userobj>
         <extension>this</extension>
         <method>getTemplateFile</method>
      </userobj>
   </path>
   <subpart>###LIST###</subpart>
   <alternaterows>###ROW1###,###ROW2###</alternaterows>
</template>

Where the function "getTemplateFile" returns the template file or empty
if it's not set.

However, when it returns an empty value it shows a Mayday.

So, I have some doubts about how to implement this feature, for example
defining a template/process property that allows to do something like
that:
<template>
   <path>
      <userobj>
         <extension>this</extension>
         <method>getTemplateFile</method>
      </userobj>
   </path>
   <process>
      <userobj>
         <php><![CDATA[
            return ($this->_oParent->getTemplateFile() != '');
         ]]></php>
      </userobj>      
   </process>
   <subpart>###LIST###</subpart>
   <alternaterows>###ROW1###,###ROW2###</alternaterows>
</template>

But I'm not sure if it's the better option, because of it's just my
first idea: I should think a bit more to find the best solution but I'd
like to ask you for more ideas.

Best regards,
   Rego

-- 
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com


More information about the TYPO3-project-formidable mailing list