dev

YouTubeButton imports the platform.js script from Google, which enables the use of YouTube subscribe buttons.

Installation

Usage

<span class="g-ytsubscribe" data-channelid="ChannellD" data-layout="default" data-count="default"></span>

Example

<span class="g-ytsubscribe" data-channelid="UCQMbqH7xJu5aTAPQ9y_U7WQ" data-layout="default" data-count="default"></span>

Output:

<span class="g-ytsubscribe" data-channelid="UCQMbqH7xJu5aTAPQ9y_U7WQ" data-layout="full" data-count="default"></span>

Output:

Parameters

Parameters Description
data-channel User channel's name in the URL. Not recommended.
data-channelid User channel's ID in the URL.
data-layout YouTube button's layout appearance. default can be used without channel's icon. full can be used with channel's icon.
data-count Channel's subscribe count to appear. default can be used to show channel's subscribe count. hidden can be used to hide channel's subscribe count.

Note

data-channel is not recommended to use it as it would appear unexpected errors from channels' own custom URLs. Their original ID can be used for data-channelid by using this tool with entering YouTube channel's URL that is using the custom name.

External links

Text above can be found here (edit)