[TYPO3-ttnews] tx_news - no entry for show latest

jaco graaff jaco at spacexplorer.co.za
Tue Jul 9 02:39:05 CEST 2013


Final Solution - I followed this:

http://docs.typo3.org/typo3cms/extensions/news/Main/Templating/Additional/Index.html
----------------------------------------------------------------------------------------------------------------------------
1. In my tsConfig.ts (I use external typoscript(ts) files) I added the 
following entry
----------------------------------------------------------------------------------------------------------------------------
/*
to see new entries in
Plugin Options -> Template -> Template Layout
*/

tx_news.templateLayouts {
        1 = Default
        99 = DetailListView
}
----------------------------------------------------------------------------------------------------------------------------
2. Refresh/Clear Cache
----------------------------------------------------------------------------------------------------------------------------
3. go to the news page and in the News Content Element :
Options -> Template -> Template Layout

I can now see my new entries and can select "DetailListView" in the dropdown
----------------------------------------------------------------------------------------------------------------------------
4. Alter the template file:

I copied the News Templates to a custom template folder in fileadmin
e.g.
webroot\fileadmin\templates\myWebSite\templates\news\Templates\News\List.html

remember to change the location of templates in the Typoscript Setup File
----------------------------------------------------------------------------------------------------------------------------
plugin.tx_news {
view {
        templateRootPath = 
fileadmin/templates/myWebSite/templates/news/Templates/
        partialRootPath = 
fileadmin/templates/myWebSite/templates/news/Partials/
        layoutRootPath = 
fileadmin/templates/myWebSite/templates/news/Layouts/
        }
}
----------------------------------------------------------------------------------------------------------------------------
5. edit the list template

add..
----------------------------------------------------------------------------------------------------------------------------
f:section name="content">
    <f:if condition="{news}">
        <f:then>
            <div class="news-list-view">

<!-- this is the new conditional statement I added -->
                <f:if condition="{settings.templateLayout} == 99">
                    <f:then>
                        put detail view template here (from LIST TEMPLATE)
                    </f:then>
                    <f:else>
                        put list view template here (from LIST TEMPLATE)
                    </f:else>
                </f:if>
.....rest of document
----------------------------------------------------------------------------------------------------------------------------
as a test I also added
----------------------------------------------------------------------------------------------------------------------------
            <f:if condition="{settings.templateLayout} == 99">
                <f:then>
put detail view template here (from DETAILS TEMPLATE)
                </f:then>
                <f:else>
put list view template here (from DETAILS TEMPLATE)
                </f:else>
            </f:if>
----------------------------------------------------------------------------------------------------------------------------
to the Details template
----------------------------------------------------------------------------------------------------------------------------
Now - when I go to my news page I see:
The LIST view configured to look like the DETAIL view (spend time and 
created a new PARTIAL for DETAIL view so I can link to it here and as you 
will see now - also in the actual DETAIL template)

but when I click on an item in the actual LIST-VIEW - the page reloads and 
now shows the DETAIL view - but from the DETAIL template - so the new DETAIL 
template needs to look the same and be replicated in both

For that I used Partial









More information about the TYPO3-project-tt-news mailing list