[TYPO3-project-formidable] Template file optional

Luc Muller l.mul-nospam-ler at ameos.com
Fri Jan 9 09:25:53 CET 2009


Hi Rego,

I'm not sure that what you're trying to do is possible for the moment.

having either the standard mode or the template mode, depending on the 
the fact that the template is present.

What I suggest you to do is to provide a "default" template in your 
extension but to allow the user to input the template either by flexform 
or by typoscript.

I've done this in ameos_formidable_rss_parser, you can have a look at 
this extension to see how it's implemented.

more, in this extension, every configuration is provided by default, can 
be overriden by TS and overriden by flexform.

Hope this helps.

Luc =:0)

Manuel Rego Casasnovas a écrit :
> 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
>
>   


-- 

*Luc Muller*
/Web Developper/
/Formidable - Rapid Application Developpement Framework for Typo3 
<http://formidable.typo3.ug>/
/Typo3 Ameos <http://www.ameos.com>/


More information about the TYPO3-project-formidable mailing list