Latest Publications

TYPO3: Raw HTML in tt_news records

When trying to embed a video in tt_news I sadly came to the conclusion this was in no way posible. There are a few extension to embed YouTube video in tt_news but since my video was from another website I was out of luck.

I wrote an extension to insert raw HTML into a tt_news record. Just install the extension and place the ###HTMLCODE### marker into your tt_news template. Should work fine ;)
Read more…

TYPO3: Simple way to convert content to PDF

A simple way to let FE-users download your content as a PDF file:

First install the extension: PDF Generator (html2fpdf) nc_pdfgen

Now add a download link at the bottom of the content:

subparts.your_content_id = COA
subparts.your_content_id {
   10 < styles.content.get
   20 < temp.PDF
}

Setup the downloadlink using the extension:

temp.PDF = COA
temp.PDF {
   10 = USER_INT
   10.userFunc = tx_ncpdfgen->openPdfLink
   20 = TEXT
   20.value = Link to PDF
   30 = HTML
   30.value = </a>
}

Add the following lines to your htaccess configuration:

RewriteRule ^[^/]*.pdf$  index.php

I left my RealURL configuration untouched. Seems to work fine.

Changing domainname using 301 moved permanently

When I switched domainnames from blog.emaux.nl to www.typo3-addict.com. Using the 301 moved permanently http header you redirect visitors directly to your new url and tell Google to visit the new url in the future.

To use this 301 header just add the following to your htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# REDIRECT BEGIN
RewriteCond %{HTTP_HOST} ^blog\.emaux\.nl [nc]
RewriteRule (.*) http://www.typo3-addict.com/$1 [R=301,L]
# REDIRECT END
</IfModule>

TYPO3: Always a ‘Save and create new’ button

Some default records and extension records offer a ‘save and create new’ button. Which is very usefull when making a lot of new records in a row. This line makes that button available for every kind of record:

createnewbutton

## Always a save and create new button
options.saveDocNew = 1

Place this line in your TSConfig…

TYPO3: Single tt_news with ratings and comment on frontpage

There is a TypoScript solution for displaying a single news item on your frontpage,  this way you don’t need to use a List of Latest element. But this is not always effective since you are not able to rate or comment this single news item, just the page.

After a long search I found this extension: xw_ttnewslatestsingle

This extension adds a new tt_news view called LatestSingle, which allows you to use your single news template for a latest news item. When used, template markers for rating and stuff from tt_news add-ons are suddenly available since these markers only work in the single template, NOT in the latest template.

This is REALLY useful for direct rating and commenting on the frontpage!

Check the screenshot:

latestsingle

TYPO3: Remove javascript warnings in the BE

Use the following in your TSConfig to disable warnings in the BE. This can be useful when you’re an experienced user. Just be careful, warning are not there just to anoy you ;)

# This option defines via a bitmask what to enable or disable
# options.alertPopups = 255 (default value)

# These options are possible:
# 1 - typeChange
# 2 - copy/move/paste
# 4 - delete
# 8 - frontend editing
# 128 - other - reserved but not used

# Example: disable warning by typeChange and copy/move/paste
# 255 - 1 -2 = 252
options.alertPopups = 252