David Ansermot Web Developer / TYPO3 Integrator

16nov/110

TYPO3 – Auto assign not-logged feuser to a fegroup

In today's short snippet, I'll give you the easiest way I now to to assign a fegroup to your visitors, without login.

1- Begin by creating your FEgroup if not done yet.
2- In your localconf.php, for exemple, add those lines :

  1. $ip = $_SERVER['REMOTE_ADDR'];
  2. $GLOBALS['TYPO3_CONF_VARS']['FE']['IPmaskMountGroups'][] = array($ip, GROUPID);

3- Replace "GROUPID" by the id of the FEgroup.

Now all your visitors are members of this FEgroup.

Enjoy !

2nov/110

TYPO3 – Get FCE’s header title in your DataStructure

Hi, today I'll give you a small but usefull tip if you use FCEs in your installations.
I prefere use the FCE's standard header title to name my FCEs and so display this title on the frontend.

5sept/110

TYPO3 – 4.5 set link target for page type “external url”

Recently, I've encountered a problem to define the target for my external urls in page tree.

The solution I found works on TYPO3 4.5 but not tested on older version.

  1. Edit external url page properties
  2. Go to the Behavior tab
  3. Set the field "Link target" with _blank (or other if needed).
See ya
18mai/110

PHP – Detect if script is running in CLI mode

It'll not be a long snippet for this.
Just a "have to know" snippet ;)

  1. $isCLI = (php_sapi_name() == 'cli') ? true : false;

Nothing more is needed.
Enjoy ;)

13avr/110

TYPO3 – Get content element from extension code

I've not wrote something from long time, so today I give you a little snippet.
If you have to use in your extension a content element from another page, you can use this function to get it from it's uid :

  1. function loadContentElement($uid) {
  2.  
  3.         $conf = array(
  4.                 'tables' => 'tt_content',
  5.                 'source' => $uid,
  6.                 'dontCheckPid' => 1,
  7.         );
  8.  
  9.         return $this->cObj->RECORDS($conf);
  10. }