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