Page 2 of 3

Re: [PLUGIN] Shortcode API

Posted: Sun Aug 28, 2016 10:05 am
by Fred
peepntom wrote:is there a code to add these to the tinymce thing? just like adding a image or link. i hit the button and add the youtube id instead of looking for the short code over and over.
Look in TinyMCE documentation ;)

Re: [PLUGIN] Shortcode API

Posted: Sat Sep 03, 2016 1:38 pm
by TomboFry
Here's a YouTube Playlist shortcode. This plugin comes with the shortcode to display a single video, however I modified it slightly to also allow for playlists too:

Code: Select all

// Add Shortcode {YTplaylist width='560' height='315' src='PLUOiYFqn8BWaJLSeProiUaAEeUupMpD3E'}
Shortcode::add('YTplaylist', function($attributes) {
	// Extract attributes
	extract($attributes);
	// src
	if (!isset($width)) $width = '560';
	if (!isset($height)) $height = '315';
	if (!isset($src)) $src = '';
	// return
	return '<iframe width="'.$width.'" height="'.$height.'" src="//www.youtube.com/embed/videoseries?list='.$src.'" frameborder="0" allowfullscreen></iframe>';
});

Re: [PLUGIN] Shortcode API

Posted: Wed Sep 28, 2016 3:44 pm
by LRAM
Here's 3 Soundcloud shortcode. Big, small and Playlist
Image

Code: Select all

// Add Shortcode {SoundCloudBig width='100%' height='315' src='271028176'}
	Shortcode::add('Soundcloudbig', function($attributes) {
	    // Extract attributes
	    extract($attributes);
	    // src
	    if (isset($width)) $width = $width; else $width = '100%';
	    if (isset($height)) $height = $height; else $height = '450';
	    if (isset($src)) $src = $src; else $src = '';
	    // return
	    return '<iframe width="'.$width.'" height="'.$height.'" scrolling="no" frameborder="no" src="//w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/'.$src.'&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true" ></iframe>';
	});
	
	// Add Shortcode {SoundCloudsmall width='100%' height='315' src='271028176'}
	Shortcode::add('Soundcloudsmall', function($attributes) {
	    // Extract attributes
	    extract($attributes);
	    // src
	    if (isset($width)) $width = $width; else $width = '100%';
	    if (isset($height)) $height = $height; else $height = '166';
	    if (isset($src)) $src = $src; else $src = '';
	    // return
	    return '<iframe width="'.$width.'" height="'.$height.'" scrolling="no" frameborder="no" src="//w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/'.$src.'&color=ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false" ></iframe>';
	});
	
		// Add Shortcode {SoundCloudplaylist width='100%' height='450' src='233684197'}
	Shortcode::add('Soundcloudplaylist', function($attributes) {
	    // Extract attributes
	    extract($attributes);
	    // src
	    if (isset($width)) $width = $width; else $width = '100%';
	    if (isset($height)) $height = $height; else $height = '500';
	    if (isset($src)) $src = $src; else $src = '';
	    // return
	    return '<iframe width="'.$width.'" height="'.$height.'" scrolling="no" frameborder="no" src="//w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/'.$src.'&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true" ></iframe>';
	});
the syntax would be

{Soundcloudbig src='271028176'} replace 271028176 with the code of the track

{Soundcloudsmall src='271028176'} replace 271028176 with the code of the track

{Soundcloudplaylist src='233684197'} replace 271028176 with the code of the playlist

Not replacing it will play my songs , it's ok for me :P

Re: [PLUGIN] Shortcode API

Posted: Sun Oct 02, 2016 1:46 pm
by Herk
How to use this if I have few pictures?
With names 1, 2, 3
{gallery id='123' size='medium'}

Re: [PLUGIN] Shortcode API

Posted: Sun Apr 23, 2017 2:50 am
by nootkan
Installed this plugin and it is telling me:
This plugin is incompatible with Bludit v1.5.2
.

I tried changing the json file to:

Code: Select all

"compatible": "1.4,1.5,1.5.2beta",
but that didn't change anything.

Re: [PLUGIN] Shortcode API

Posted: Sun Apr 23, 2017 2:54 pm
by Edi
You have to change it to the following:

Code: Select all

"compatible": "1.4,1.5,1.5.2",

Re: [PLUGIN] Shortcode API

Posted: Mon Apr 24, 2017 2:39 am
by nootkan
Okay thanks. It is still okay to use right?

Re: [PLUGIN] Shortcode API

Posted: Mon Apr 24, 2017 11:29 am
by Edi
If it works... The message is only a warning "This plugin is not tested with Bludit ...".

Re: [PLUGIN] Shortcode API

Posted: Wed Nov 22, 2017 10:20 pm
by AlexanderLiebrecht
Hi @Fred ,

We know each other from your support flatboard forum and I did not think that you also develop plugins. That suits me very much, because I wanted to ask you after the upgrade for the shortcode Api for Bludit 2.0.2.

Would that be feasible or are you not doing any more in that sense?

Thanks in advance and best regards from Rostock.

Re: [PLUGIN] Shortcode API

Posted: Wed Aug 08, 2018 2:25 pm
by stevang
Hey,

I just have finally migrated from 1.5 to 1.6 and to 2.3.4
But after having most running as it was before, i cant use the shortcode plugin anymore. so currently my posts show something like {Youtube width='560' height='315' src='WQ8X6RG547Y'} only.
Is it possible to update the shortcode plugin or use some similar plugin to make it work again in 2.3.4?

Regards,
Stephan