[TYPO3-mvc] managing templates

Stefan Isak stefanisak at googlemail.com
Mon Oct 18 13:56:22 CEST 2010


Use an if viewhelper to achieve the needed error message. Have a look at
blog_example/Resource/Private/Templates/Post/index.html

<f:if condition="{posts}">
  <f:then>
     ...
  </f:then>
  <f:else>
         <p>This blog currently doesn't contain any posts.</p>
  </f:else>
 </f:if>

Add your localizations to Resources/Private/Language/locallang.xml.
You can access those values using fluid translate view helper e.g.:
<f:translate key="foo" />

Cheers
Stefan

2010/10/18 Dawid Pacholczyk <dpacholczyk at gmail.com>

> For example I would like to create a list BUT if there are no records that
> can be listed I would like to display an error message.
>
> Thanks for your advice. Now I need to find a way to use locallang :) But I
> bet that I`ll find it in blog_example :)
>
> Best regards,
> Dawid "Fixus" Pacholczyk
>
> 2010/10/18 Stefan Isak <stefanisak at googlemail.com>
>
> > Hey,
> >
> > have a look at the different possibilities to structure templates. You
> can
> > find examples in the blog_example extension.
> >
> > What would you like to do, that you want to have two different templates
> > for
> > the same action?
> >
> > Users can create there own templates e.g. using a different template root
> > path.
> > Default value is: plugin.tx_myext.view.templateRootPath =
> > EXT:myext/Resources/Private/Templates/@Controller/@actionname. at format
> >
> > Cheers
> > Stefan
> >
> >
> > 2010/10/18 Dawid Pacholczyk <dpacholczyk at gmail.com>
> >
> > > Hello List,
> > >  how can I manage templates in my ext ?
> > >
> > > For example. In old school ext creating there was a file with diffrent
> > > subparts. For example I could create two subparts ###STATUS_OK### or
> > > ###STATUS_NOT_OK### and use the one that I need.
> > >
> > > In extbase/fluid method I have for example listAction() and list.html
> > >
> > > How can I load 2 diffrent lists if I need ?
> > >
> > > Or how can end user create his own templates ? This is another example.
> > In
> > > old schoold I could give user possibility to add his own .html file.
> How
> > > can
> > > I do that in extbase/fluid ?
> > >
> > > Best regards,
> > > Dawid Pacholczyk
> > >
> > > --
> > > Dawid Pacholczyk
> > > tel: 502-054-334
> > > gg: 5564051
> > > skype: dpacholczyk
> > > http://typo3blog.pl (only polish version at the moment)
> > > _______________________________________________
> > > TYPO3-project-typo3v4mvc mailing list
> > > TYPO3-project-typo3v4mvc at lists.typo3.org
> > >
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> > >
> > _______________________________________________
> > TYPO3-project-typo3v4mvc mailing list
> > TYPO3-project-typo3v4mvc at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> >
>
>
>
> --
> Dawid Pacholczyk
> tel: 502-054-334
> gg: 5564051
> skype: dpacholczyk
> http://typo3blog.pl (only polish version at the moment)
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list