[PLUGIN] Shortcode API

User avatar
Fred
Legend Bludit
Posts: 236
Joined: Wed Jun 24, 2015 2:14 pm
Location: France
Contact:

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 ;)
╰☆╮Bludit╰☆╮ is a open source and community contributions are essential to project success!
You are looking for a light forum based Json? Try my project Flatboard, it is free. ;)
Sorry for my little english, i'm french :oops:
TomboFry
Jr. Bludit
Posts: 1
Joined: Sat Sep 03, 2016 1:31 pm

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>';
});
User avatar
LRAM
Master Bludit
Posts: 199
Joined: Sat Sep 24, 2016 4:02 pm
Location: France
Has thanked: 22 times
Been thanked: 2 times
Contact:

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
https://sucrepop.com
Candies for the ears
User avatar
Herk
Sr. Bludit
Posts: 38
Joined: Wed Aug 19, 2015 8:31 am

How to use this if I have few pictures?
With names 1, 2, 3
{gallery id='123' size='medium'}
nootkan
Sr. Bludit
Posts: 43
Joined: Tue Feb 14, 2017 4:59 pm

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.
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

You have to change it to the following:

Code: Select all

"compatible": "1.4,1.5,1.5.2",
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
nootkan
Sr. Bludit
Posts: 43
Joined: Tue Feb 14, 2017 4:59 pm

Okay thanks. It is still okay to use right?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

If it works... The message is only a warning "This plugin is not tested with Bludit ...".
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
AlexanderLiebrecht
Jr. Bludit
Posts: 4
Joined: Wed Nov 22, 2017 10:14 pm

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.
Blogger, Webmaster, Linux/CMS-Admin, Wiki-Writer, CMS-Installateur und CMS-Fan from Rostock, Germany. Main-Blog: https://internetblogger.de and Bludit-Page under http://bludit.wpzweinull.ch
stevang
Jr. Bludit
Posts: 7
Joined: Wed Feb 28, 2018 7:06 pm

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
Post Reply