How do i change default header in TYPO3


Some time we need to change default header then we can easily change default header via following typoscript.

content.defaultHeaderType = 3

We have set defaultHeaderType is 3. its mean whenever we used default from header then it will render as h3 tag.

if we want to set default header as H2 tag then we can use simply 2 in defaultHeaderType

Like

content.defaultHeaderType = 2

I hope it will work for you 🙂

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

How get all the PDF files from directory and sub directory


For check pdf files in directory and sub directory

First we have to read folder and we will get directory and file name from folder.

then we will check is directory or not.

if we get directory then we again call the same function for get sub directory and file from current directory

and we will separate pdf file name from file extension.

Following code will help you for get pdf file list from mentioned directory name or we can also get all files from directory

$directory = 'typo3/fileadmin';

function expandDirectories($base_dir) {

    $directories = array();

    foreach(scandir($base_dir) as $file) {
		
        if($file == '.' || $file == '..') continue;

        $dir = $base_dir.DIRECTORY_SEPARATOR.$file;

        if(is_dir($dir)) {
            $directories = array_merge($directories, expandDirectories($dir));
        }else{
            if(strstr($dir,".pdf")){
                $directories []= $dir;
            }
        }
    }
    return $directories;
}

$directories = expandDirectories($directory);

print_r($directories);

You will get list of pdf file with directory name.

i hope it will work for you 🙂 njoy 😉

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

How do i skip controller and action for custom extension in typo3


This is really necessary to remove extra parameter for SEO purpose

Following script will help you more. you need to set this typoscript in your setup file

config.tx_jsfaq.features.skipDefaultArguments = 1
plugin.tx_jsfaq.features.skipDefaultArguments = 1

Note : tx_jsfaq

This is the extension name. you have to use your extension name

After applying this controller and action will be removed from url

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

How do i skip controller and action for tt_news in typo3


This is really necessary to remove extra parameter for SEO purpose

Following script will help you more. you need to set this typoscript in your setup file.

plugin.tx_news {
    settings {
        link {
            skipControllerAndAction = 1
        }
    }
}

After applying this controller and action will be removed from url

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya

How to wrap the content in RTE + typo3


wrap all the content coming from the RTE around a div tag.

Here following script will help you more for wrap your RTE content with particular div

tt_content.text.20.wrap = < div class="contentArea" >| </div >

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya