Standalone view in extbase

Usually a view in extbase is always called from a controller.  but what if, an action in your controller is called as an eID and only parts of the template needs to be rendered? Partial is an option, but I have a code snippet, which uses the

class.

Continue reading Standalone view in extbase

redirect URL to lowercase

Using the realurl extension TYPO3 generate human-readable URL. If the visitor visits the page using uppercase of the URL, TYPO3 can generate the page (HTTP 200). if a search bot (Google) found this URL and indexed it, Google will declare the page as “double content” and punishes your page rank. How do we deal with this? Continue reading redirect URL to lowercase

[PHP] Removing duplicate in an array… really fast

Let’s imagine you have a huge array, with say couple ten thousands of elements and you want to remove any duplicates entries in this array. As PHP programmer you’ll be thinking of array_unique. For a “small” sized array and one dimensional array this one does the trick.

I have some nice snippets which cover multi dimensional and/or huge sized array.

First: you have a huge, one dimensional array.

This one works only on one dimensional array. The key of the last element will be preserved and the keys are not sorted

Second: for a huge, multi dimensional array

sources:

  1. http://dk.php.net/manual/en/function.array-unique.php#97285
  2. http://www.puremango.co.uk/2010/06/fast-php-array_unique-for-removing-duplicates/

Wrapping image based on width… pure TypoScript

following issue: images should be wrapped with various class parameter (or div, or whatever) based on its width. And it should be solved only per TypoScript…

hmmm… quite a difficult one, don’t you think? well, you know what… I solved it… 😀

Continue reading Wrapping image based on width… pure TypoScript