windows command line for delete specific files with extension


Some time we want to delete some specific file or we facing issue of virus in our computer that time we have to delete that specific file manually

If we want to delete all .exe file together from selected folder than we have to use following command.

D:\Jainish> del /S *.exe

It mean it will delete all exe file from Jainish folder from From D Drive.

If you want to delete jpg file than used “D:\Jainish> del /S *.jpg”

If you have any query then feel free to contact me at Jainish Senjaliya</a>

 

 

How to get current page title in extension of typo3


Following script will help you for display current page title in your extension.

//Get the current page Title
$currenttitle  = $GLOBALS['TSFE']->rootLine;

I hope it will work for you. Good Luck 😉

If you have any query then feel free to contact me at Jainish Senjaliya

How to extend news with extra field in typo3


Many time we need to extend news with some text fields or any other table relation.

We can directly in news extension. better we can extend through other extension.

For that first we need to create that fields in news table.

So following SQL you need to extend in your extension [ in ext_tables.sql file ]

CREATE TABLE tx_news_domain_model_news (
    category int(11) unsigned DEFAULT '0',
);

than after you need to add following code in ext_tables.php. this extended category will display before bodytext area.

$extendCategory = array(
    'category' => array (
        'exclude' => 0,
        'l10n_mode' => 'noCopy',
        'label' => 'Sponsors',
        'config' => array(
            'type' => 'select',
            'items' => array (
                array('',0),
            ),
            'renderType' => 'selectSingle',
            'foreign_table' => 'tx_jsfaq_domain_model_category',
            'minitems' => 0,
            'maxitems' => 1,
        ),
    ),
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
    'tx_news_domain_model_news',
    $extendCategory,
    1
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
    'tx_news_domain_model_news',
    'paletteArchive', '--linebreak--,category','after:bodytext'
);

If you have any query then feel free to contact me at Jainish Senjaliya

How to change image dimension in RTE + typo3


Whenever we are used image in RTE that time “Image Magic” is generate new image automatically.

When adding a picture inside the RTE (Rich Text Editor) via the Insert/modify image icon it is important to choose ‘New Magic Image’ rather than ‘New Plain Image’ at the top of the popup window and then select the image. This way the image will automatically be reduced.

The “Image Magic” automatic target resize can be altered with the following TSConfig code.

RTE.default.buttons.image.options {
    # realistic magic insert sizes
    magic.maxWidth = 600
    magic.maxHeight = 600
}

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

How to remove related videos from the end of an embedded YouTube video


YouTube displays related videos at the end of videos you have viewed. This can be useful when we are generally watching video in youtube. but this can also be annoying and problematic.

I remembered that I had seen that we can remove related videos from the end of a YouTube video.

it’s really quite easy and simple to do!

Here is a emabeded code for Video URL

< iframe width="560" height="315" src="https://www.youtube.com/embed/4ALbrJVt1u4" frameborder="0" allowfullscreen > </ iframe>

Here is a example for you tube video. just check at end of the video. it will display all related video

If you dont want to display related video at end of youtube video then just add query string “?rel=0” to the link.

Just check the following link

< iframe width="560" height="315" src="https://www.youtube.com/embed/4ALbrJVt1u4?rel=0" frameborder="0" allowfullscreen > </ iframe>

Here is a example for you tube video. just check at end of the video.

If you are using embedded YouTube video thn youtune also give option for customize the video’s appearance on your site.

The first option is a checkbox that says “Show suggested videos when the video finishes.”

Make sure that box is unchecked. If you look at the embed code, you’ll see that it adds a parameter after the video’s URL:

This is also work when you are not used embeded videos.

You just need to add a query string “?rel=0” to the link.

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

How to remove the trailing slash from url’s at RealURL + typo3


I got my grade for some time racking their brains on how to the trailing slash, the RealURL automatically adds that slash if “defaultToHTMLsuffixOnPrev” is not set

http://www.example.com/artical/ -> http://www.example.com/artical

Here we have two solution for remove the trailing slash from url.

The following solution is extremely simple and banal, does not require any manipulation of the core files – only a “value” is entered in “defaultToHTMLsuffixOnPrev”.

First Solution

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array (
    'fileName' => array (
        'defaultToHTMLsuffixOnPrev' => chr(0),
    ),
);

if some time its not workout that time you can use 
'defaultToHTMLsuffixOnPrev' => chr(1),

Second Solution

function user_encodeSpURL_postProc(&$params, &$ref) {
    if ($params['URL'] != '/') {
        $params['URL'] = preg_replace(
            '/\/($|\?|\#)/U',
            '\1',
            $params['URL']
        );
    }
}

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
    'EncodeSpURL_postProc' => array ( 'user_encodeSpURL_postProc'),
    '_DEFAULT' => Array (
    'Init' => array (
            // [...]
            'AppendMissingSlash' => 'ifNotFile'
            )
        // [...]
    )
);

URL will look like after applying above script :

www.example.com/artical

Second method may be not work for old version of realurl. so better we use first method

If you need trailing slash from url then simply use 0 in “defaultToHTMLsuffixOnPrev”

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array (
    'fileName' => array (
        'defaultToHTMLsuffixOnPrev' => 0,
    ),
);

URL will look like after appling above script :

www.example.com/artical/

If you need trailing with .html from url then simply use 1 in “defaultToHTMLsuffixOnPrev”

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array (
    'fileName' => array (
        'defaultToHTMLsuffixOnPrev' => 1,
    ),
);

URL will look like after appling above script :

www.example.com/artical.html

I hope today i make your day 😉

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