David Ansermot Web Developer / TYPO3 Integrator

3nov/100

Joomla – Detect homepage in extensions

Here's a little tip to detect, in your Joomla extensions, if the Frontend user is on the Homepage.

  1. if (JURI::base() == JURI::current()) {
  2.      // Your code for Homepage
  3. }

Tell me if it bugs for you, but for me on 1.5.21 it's ok

20oct/100

TYPO3 : tt_news GIFBUILDER news title

If you want, like me, make your news title builded as a nice image with cool font, you can use this snippet.

Of course, you can do the same for the other wraps ;)
(remove spaces in HTML line 6)

  1. plugin.tt_news.displayLatest.title_stdWrap.cObject = COA
  2. plugin.tt_news.displayLatest.title_stdWrap.cObject {
  3.                        
  4.         10 = COA
  5.         10 {
  6.                 wrap = < div style ="background -repeat: no-repea t; | ">
  7.                                
  8.                 10 = IMG_RESOURCE
  9.                 10 {
  10.                         stdWrap.wrap = background-image: url( | );
  11.                                        
  12.                         file = GIFBUILDER
  13.                         file {
  14.                                 XY = [10.w],[10.h]+10
  15.                                 format = gif
  16.                                 quality = 100
  17.                                 backColor = #333333
  18.                                        
  19.                                 10 = TEXT
  20.                                 10 {
  21.                                         text.field = title
  22.                                         text.case = upper
  23.                                         fontSize = 14
  24.                                         fontColor = #ffffff
  25.                                         fontFile = {$lib.conf.template}fonts/TrajanPro-Bold.otf
  26.                                         niceText = 1
  27.                                         offset = 0,16
  28.                                         breakWidth = 286
  29.                                 }
  30.                         }
  31.                 }
  32.                                
  33.                 20 = TEXT
  34.                 20 {
  35.                         wrap = width: | px;
  36.                         value = 286
  37.                 }
  38.         }
  39.                
  40.                        
  41.         20 = TEXT
  42.         20 {
  43.                 wrap = <span class="hideMe"> | </span>
  44.                 field = title
  45.         }
  46. }

This code is easily extensible.
Hope it helps you ;)

19oct/100

Magento : Add sorting condition

Today, I add to make my category menu reflect the category order in the backend (not ordered by name).

The only thing you have to do is to add "addAttributeToSort('attName', 'sortDirection')" in your template the next function in the loading instruction.

$collection = Mage::getResourceModel(’catalog/category_collection’)
->addAttributeToSelect(’name’)
->addAttributeToSort('position', 'asc')
->addAttributeToFilter('is_active', 1)
->load();

Hope it'll help you too.
Enjoy

3mar/100

Google Summer of Code 2010 coming up

As you know (or not), TYPO3 was in the Google Summer of Code 2009 and it was very successful. TYPO3 team want to do better this year. Take a look about what they wrote.

We are excited that Google Summer of Code is underway again this year. After having had a successful first Google Summer of Code last year, we are happy to also apply for GSoC 2010.

We're looking for help to make this years Summer of Code even better than last year and are asking you to think about how things could improve.

Read the full article

19fév/100

jQuery – Element exists ?

Here's a very small snippet about how to know if a Dom element is on the document with jQuery

  1. var myElement = $('#myElement');
  2. if (myElement.size() == 0) {
  3. // Element doesn't exists
  4. } else {
  5. // Element exists
  6. }