VF DSL 468x60

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 10:07:
hi this april i want to register this website

Add comment

* - required field

*



*
*

Top 10 Updates

Creating a simple Infocenter using TYPO3 geändert am  17-Nov-2009 11:12:52
Making the Section Menu work correctly with TemplaVoila geändert am  05-May-2009 10:27:17
Show pages with type "Not in Menu" in a sitemap geändert am  05-May-2009 10:11:17
Implementation of the DHTML menu from brainjar.com  geändert am  01-Feb-2009 13:02:48
Sample DHTML menu geändert am  01-Feb-2009 12:51:25
A introduction to the CONTENT object geändert am  26-Jan-2009 12:20:39
Sample for dynamic image masks geändert am  16-Dec-2008 15:42:32
Useful Links geändert am  11-Dec-2008 10:06:17
Using Transparent PNG's in IE5/6 without JavaScript geändert am  04-Oct-2008 12:27:15
Using lightbox without extension geändert am  13-Jun-2008 14:20:51

Latest comments

23-Feb-2010 04:40:25
Janna schrieb: what about the css? I am still not clear how to link typoscript with the css. Kindly...
Text menu
05-Feb-2010 18:38:50
Martin Terber schrieb: Didn't work for me neither. I will try in TMENU now.
Alternativ sorting for menu items
27-Jan-2010 23:41:31
romx schrieb: U know its dob't work apply to Tmenu))
Alternativ sorting for menu items
Deutsch
Search: