Show newest forum post

Submitting your vote...
Not rated yet. Be the first who rates this item!
Click the rating bar to rate this item.

This Typo3 Code Snippet shows the newest forum post on your page. This snippet was written for the CHC-Forum. The TypoScript code can be easily modified. If you want for example display the 10 latest post on your forum you only have to set the max=10.

If there is no forum post the text "No forum posts" will be shown. If there are forum posts the following information will be shown for the newst one: Topic, first 20 characters of text and the date and time.

The topic will automatically linked to correct thread of the post in the forum, this way you can reach the post very fast.

 

 

temp.lastpost=COA_INT
temp.lastpost{
  10=CONTENT
  10.table=tx_chcforum_post
  10.select {
      #id of the sysfolder where the forum posts are stored
    pidInList=27
    orderBy=tstamp DESC
    max=1
  }
  10.renderObj =COA
  10.renderObj{
     
    10=TEXT
    10 {
      field=post_subject
      wrap=Topic:&nbsp;|<br>
        #id of the pages where the forum is
      typolink.parameter=6
      typolink.additionalParams.insertData=1
      typolink.additionalParams=&thread_uid={field:thread_id}&view=single_thread
    }
    20=TEXT 
    20 {
      field=post_text  
      crop=20
      wrap=Text:&nbsp;|...<br>
    }
    30=TEXT
    30{
      field=tstamp 
      strftime=%m/%d/%Y %H:%I:%S
      wrap=Postet on: |
    } 
  }
  20=TEXT
  20.value=No forum posts
  20.if.isFalse.numRows < .10 
   
  wrap=Our newest forum post:<br>|
}

 

To get this snippet working just copy the code to the TypoScript Setup of your TYPO3 template. Then copy the temporary object to a marker of your choice for example:

 

page.10.subparts.FORUM < temp.lastpost

 

 

More information on this topic can be found here

Snippet numRows sample

Snippet typolink sample

 

TSREF Content

TSREF numRows

TSREF select



Comments


April, 12-06-09 12:07:
hi this april i want to register this website
swagatika, 01-02-11 06:33:
I simply bonk the business and the grapheme of its fill, and bonk learned the faithful signification of sharing in sports. Then I began playing it … and the reside is history. I'm hooked for account.
___________
leena

Add comment

* - required field

*



*
*

Top 10 Updates

Nice fonts using Google font API geändert am  20-May-2010 16:36:47
TS-based Searchbox for Indexed Search  geändert am  18-May-2010 18:27:15
TYPO3 SEO geändert am  30-Apr-2010 09:44:22
Search engine friendly graphical headers in TYPO3 geändert am  30-Apr-2010 09:33:44
Creating a simple Infocenter using TYPO3 geändert am  17-Nov-2009 12:12:52
Making the Section Menu work correctly with TemplaVoila geändert am  05-May-2009 12:27:17
Show pages with type "Not in Menu" in a sitemap geändert am  05-May-2009 12:11:17
Implementation of the DHTML menu from brainjar.com  geändert am  01-Feb-2009 14:02:48
Sample DHTML menu geändert am  01-Feb-2009 13:51:25
A introduction to the CONTENT object geändert am  26-Jan-2009 13:20:39

Latest comments

21-Jan-2012 20:22:24
jemmkwc jemmkwc schrieb: MOGWOX , [url=http://prdpuhwzxyrc.com/]prdpuhwzxyrc[/url],...
fe_useradmin form does not save
20-Jan-2012 20:35:32
fsivjktiuld fsivjktiuld schrieb: idCmnv <a href="http://gakbrrkrxhye.com/">gakbrrkrxhye</a>
fe_useradmin form does not save
19-Jan-2012 18:05:25
bvffee bvffee schrieb: jl2vQt , [url=http://xcinvpbclrbm.com/]xcinvpbclrbm[/url],...
External links and shortcuts directly in the menu
Deutsch
Search: