Open the Images present in tt_products List and Single view in Lightbox using Perfectlightbox

Hi Friends,

The following code is used to open the images in Lightbox that are present in the tt_product, List and Single views. Please add these lines in typoscript.

plugin.tt_products {
image {
imageLinkWrap {
typolink {
parameter.cObject = IMG_RESOURCE
parameter.cObject.file.import.data = TSFE:lastImageInfo|origFile
parameter.cObject.file.maxW = {$plugin.perfectlightbox.lightBoxMaxW}
parameter.cObject.file.maxH = {$plugin.perfectlightbox.lightBoxMaxH}

ATagParams = rel=”lightbox”
ATagParams.override = rel=”lightbox[sb{field:uid}]” #hier UID übergeben
ATagParams.override.if.isTrue = {$plugin.perfectlightbox.imgtext.navigable}
ATagParams.insertData = 1
}
}
}
listImage < .image
listImage.file.maxW = {$plugin.tt_products.maxW_list}
listImage.file.maxH = {$plugin.tt_products.maxH_list}
listImage.imageLinkWrap = {$plugin.tt_products.clickEnlarge_list}
}

If the image needs to be rotated in the Lightbox please add the following line

parameter.cObject.file.params = -rotate 90

Technorati : , , ,

How to get an old TYPO3 Extension from Repository

In some cases we may need to get an old TYPO3 extension, this may be for several reasons.

In order to do this, we can follow any of the following methods:

METHOD 1:

  1. Go to http://www.typo3.org/extensions then search for your extension, say tt_news
  2. Just copy yhe download link of the t3x file, and now my link looked as below: http://typo3.org/fileadmin/ter/t/t/tt_news_3.0.1.t3x
  3. We need the version 2.5.2, so change the version number of above URL to as follows:
    http://typo3.org/fileadmin/ter/t/t/tt_news_2.5.2.t3x

METHOD 2:

This is one way, the other way is when we use the update manager within TYPO3 BE, we get a drop down to select the version, and load it’s detail. Then we can install/update the necessary version. Sometimes the drop down may not have the needed version, so Method 1 may work in such cases!

METHOD3:

Most extensions were also under version control on typo3 forge, even here we can get the old files. We may however get some files/updates/changes that were not really published to the Extension Repository. So this may be slightly risky as well. Generally the first two methods are much more easier.

jcarousel adds empty item in circular mode

When using the circular mode in jCarousel(wrap : ‘circular’), we used to see a blank item initially, whhich used to get cleared in the next iteration.

i.e. It seemed like jCarousel generally expects at least one extra item, than the width of scroll area.
In our case the width of scroll area was occupied by 3 items then jQuery needs 3+1 news initially.
If width of scroll area is occupied by 4 news, then there must be 5 news minimum.

Now in such situation we must pre-fill some extra items, that has solved the issue.
ex:

/* When there is less than or equal to 3 items,
* the jcarousel shows blank items in the circular mode!
* So we will add some extra items in such case
* */
if( jQuery(‘#jcarousel .slider-ul’).length <= 3 ){
tempHtml = jQuery(‘#jcarousel .slider-ul’).html();
while(jQuery(‘#jcarousel .slider-ul’).length >= 4){
jQuery(‘#jcarousel .slider-ul’).html(tempHtml + tempHtml);
}
}

jQuery(‘#jcarousel .slider-ul’).jcarousel({
scroll : 1,
auto : 5,
wrap : ‘circular’
});

Hope this helps someone.

How to find and change TYPO3 settings.

This is a small reference to give an idea on how to find a TYPO3 setting that can be changed, and how to change it.

Easy:

  1. go to BE
  2. Click the Configuration module in left menu bar
  3. Now use the drop down at the top, and select TYPO3_CONF_VARS.
  4. Search for what you need
  5. Click on the needed title
  6. Now you get a array like this:
    $TYPO3_CONF_VARS[‘EXTCONF’][‘cachecleaner’][‘tables’][‘cache_pages’][‘expireField’] = ‘expires’;
  7. Change this in your extension (in a PHP file) and include this file in ext_localconf.php
    OR Directly write inside ext_localconf.php (well this may not be very clean)

NOTE: The CONFIGURATION Module is like a TREE browser which lists all kind of available configurations available in TYPO3.
So we have endless chance to change and customize almost anything here!

NOTE2: The TYPO3 Configuration Module is also a place where you can see the current configuration that is in use.
This can be used for wide range of debugging, such as:

  1. To analyze if a HOOK/XCLASS has been declared or not
  2. To see if the configuration we specified has been really recognized by TYPO3

ENJOY!

Adding new fields to existing TYPO3 tables at desired location.

NOTE: This post is intended to add a new field to an existing TYPO3 table at any desired position.
Kickstarter is initially used to add the new field, then we will use fthe following trick to add our new field to a desired location.

GOAL: Add new field called company name, after the subheader field for tt_news of type “External URLS”

STEP 1: Look into the ext_tables.php containing the following method of adding new field to TCA Array.

t3lib_div::loadTCA(‘tt_news’);
t3lib_extMgm::addTCAcolumns(‘tt_news’,$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes(‘tt_news’,’tx_ttnews_fieldcompany;;;;1-1-1′);

STEP 2: Replace the above 3 lines as follows:

t3lib_div::loadTCA(‘tt_news’);
t3lib_extMgm::addTCAcolumns(‘tt_news’,$tempColumns,1);
$TCA[‘tt_news’][‘types’][‘2’][‘showitem’] = str_replace(‘short,’, ‘short, tx_ttnews_fieldcompany,’, $TCA[‘tt_news’][‘types’][‘2’][‘showitem’]);

STEP 2: Alternate, using TYPO3 API (Thanks to Oliver for the code):

t3lib_div::loadTCA(‘tt_news’);
t3lib_extMgm::addTCAcolumns(‘tt_news’,$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes(“tt_news”,”tx_ttnews_fieldcompany;;;;1-1-1″, “”, “after:short”);

STEP 3 Clear cahce and check the news record.
That’s it, now clear your TYPO3 config cache, and check the record, the new field is now just after the sub header field in tt_news record of type External URL.