Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GS Shortcodes
#1
GS_Shortcodes is a port of Wordpress Shortcodes for GetSimple.

Download version 1.0 from extend:
http://get-simple.info/extend/plugin/gs-shortcodes/493/

It comes with the following Shortcodes built in and ready for use:

* PageField
* Youtube Video
* Google Chart
* Vimeo Video
* Google Maps

CREATING YOUR OWN SHORTCODES

As GS_Shortcodes is a port of Wordpress shortcodes any tutorials for developing also apply here.

There is also a file in GS_Shortcodes\shortcodes_sample.php which has tons of example shortcodes.

INCLUDING SHORTCODES IN YOUR THEME

If you wish to add new shortcodes to your theme or distribute them as part of a theme just create a shortcodes.php in the root of your theme folder. It will be read in by the system.


BUNDLED SHORTCODES

PAGEFIELD
The pagefield shortcode allows you to output any field from any page in your pages.

For example if you wished to output the published date of the current page you would use

[ pagefield field='pubDate' ]

This page was published: Mon, 02 Jul 2012 22:01:08 +0100

To output the field from another page use

[ pagefield page='index' field=title' /]

The title of the index page is: Welcome to TheMatrix


YOUTUBE VIDEO
The YouTube shortcode allows you to insert YouTube videos in your pages.

It accepts 3 parameters

id - the id of the YouTube video you wish to embed
width - width of the video
height - height of the video

To display a Youtube video just enter

[ youtube id='aGSKrC7dGcY&ob=av2e' width='500' height='300' /]


VIMEO VIDEO
The Vimeo shortcode allows you to insert Vimeo videos in your pages.

It accepts 3 parameters

id - the id of the YouTube video you wish to embed
width - width of the video
height - height of the video

So now in your pages if you want to insert a Vimeo video just enter

[ vimeo id='44467835' width='500' height='300' /]


GOOGLE CHART
This shortcode allows you to use the Google Chart API to create a dynamic charts in your pages.

It accepts the following parameters:

type, type of chart - line, xyline, sparkline, meter, scatter, venn, pie, pie2d
data, comma delimleted data
colors, comma delimeted list of Hex colors for data
size, width by height of chart. eg. 500x300
bg, Hex color for background
title, title of chart
labels, comma delimeted list of labels for data
advanced, other options see Google Chart API for more details

For example :

[ chart data="41.52,37.79,20.67,0.03" bg="F7F9FA" labels="Reffering+sites|Search+Engines|Direct+traffic|Other" colors="058DC7,50B432,ED561B,EDEF00" size="488x200" title="Traffic Sources" type="pie"]

GOOGLE MAPS

This shortcode allows you to insert a Google Map into your pages.

You can use the following options to customize your map:

lat , latitude
lon , longtitude
id, unique ID for multiple maps
z, zoom level, 0=world, 20=fully zoomed
w, width of map (default 400)
h, height of map (default 300)
maptype, map type ROADMAP | SATELLITE | HYBRID | TERRAIN
address, any valid google map address
marker, add a marker to the map
markerimage, url to a custom marker image
infowindow, text to display in an infowindow, marker should be set to true
infowindowdefault, show an info window (yes or no) default no
hidecontrols => 'false',
scale => 'false',
scrollwheel => 'true'

Adding a map to your page

To add a basic world map to your page just use

[ googelmap]

The address parameter accepts any valid Google maps address, and the "z" parameter for zoom level (ex: 0=world, 20=really zoomed in)

Ex: [ googlemap address="'Dublin, Ireland" z="7" ]

Multiple Maps

If you want to use multiple maps on a page you must specify an 'id' on each shortcode:

Ex: [ googlemap id="map1" address="'Dublin, Ireland" z="7" ]

[ googlemap id="map2" address="'Dublin, Ireland" z="7" ]

*** Note all the above examples have a space between the first [ and the shortcode remove the space if pasting.
My Github Repos: Github
Website: DigiMute
Reply
#2
Are there any examples or docs on how this works or what its purpose functionality is ?

The one on your site didn't help me out much, I have no idea what a call-to button or bartag means.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
I've updated the page with an example for Youtube videos.

Any online documentation for Wordpress shortcodes will also apply here.
Check out WP own docs here : http://codex.wordpress.org/Shortcode_API
and at the bottom of that pages for more examples.
My Github Repos: Github
Website: DigiMute
Reply
#4
Bumping this topic as I have just released GS_Shortcodes in Extend.

http://get-simple.info/extend/plugin/gs-shortcodes/493/

Please use this thread for any issues or if you have any shortcode examples that you wish to share.
My Github Repos: Github
Website: DigiMute
Reply
#5
Nice plugin. Is it possible to use shortcodes directly in a template file? I thought it might be an easy way to insert a Google Map into my template, but the shortcode was just rendered as text.
Reply
#6
Try with:
Code:
<?php echo do_shortcode('[googlemap]'); ?>
Reply
#7
One of my customers needed an easy way to embed XSL files in his site on regular basis.

I made him a solution using the GS Shortcodes , but I changed the structure a bit + a language help file, so I attach it here if you'll want to adopt it to the "official" plugin.

I used a class for reading Microsoft Excel (97/2003) Spreadsheets (http://code.google.com/p/php-excel-reader/) ... enhanced with a few fixes I had to adapt for proper UTF-8 ( for Multi-bite Langs - as Hebrew) , and for "empty table cells" ....

xls2html is enabeling you to embed XLS files as HTML tables in your site pages

You need to upload your xml file(s) to your data/uploads/xls/ directory, and specify the name of the file in the file="" section.
  • file => '' (Name of the xls file)
  • rownumbers => 'false' (show/hide top row numbers, defauld=false)
  • coletters => 'false' (show/hide side col letters, defauld=false)
  • sheetnum => '0' (number of the sheet to show from the file, defauld=0)
  • tableclass => 'excel' (the class of the table, defauld=excel)
  • tableid => 'excel' (the id of the table, defauld=excel)
The table keeps most of the original XLS file formats (font-color, cells background, etc' ...)

Ex: [xls2html file="" rownumbers="" coletters="" sheetnum="" tableclass="" tableid="" /]

I'm attaching it here , but if there will be a need I can make a stan-alone plugin out of this ... though the "GS Shortcodes" is enough if n00dles101 wants to add it ...

My version is attached + 2 screenshots: the table result in a page (Hebrew, sorry) and the help section I improved @ the admin side ...


Attached Files Thumbnail(s)
       

.zip   gs_shortcodes.zip (Size: 30.43 KB / Downloads: 17)
Reply
#8
This plugin is on github if you want to fork and pull it for n00dles.

Oh and this is pretty neat addition.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#9
(2013-06-01, 01:57:58)shawn_a Wrote: This plugin is on github if you want to fork and pull it for n00dles.

Oh and this is pretty neat addition.

10x

Well, If he'll like the /plugs/ idea ... there will probably be a few more ideas to enhanced it .
Reply
#10
Is there a way to create a short code to play FLV video uploaded to the oploads folder?
Reply
#11
@Tzvook, yeah like the idea of the plugs folder for additions.
Might expand on it and do like plugins.

each shortcode plugin has a folder with shortcodes.php file which will be read in automatically.

will check it out and update the SVN.

Thanks...
My Github Repos: Github
Website: DigiMute
Reply
#12
(2013-06-06, 22:45:35)n00dles101 Wrote: @Tzvook, yeah like the idea of the plugs folder for additions.
Might expand on it and do like plugins.

each shortcode plugin has a folder with shortcodes.php file which will be read in automatically.

will check it out and update the SVN.

Thanks...

Great, I'll wait for it and will do some more plugins when it's ready ....
Reply
#13
thanks for the plugin, just a quick note, since i was not able to find (my fault?) extensive documentation, I had to guess some allowed values, maybe those can help others. In googlemap some html with escaping is allowed for the infowindow message:

infowindow='come visit \"Old Pub\"<br> &nbsp;&nbsp;&nbsp;best bar in town'

a small suggestion for next version, please allow w and h to be defined not only in pixel but as % too (better allow everything from em to vw). I'm testing that plugin on a responsive site and need to define height in pixel but width in %. I know most (all?) modern browser correct my error if i enter v=100% and plugin converts to html style="width:100%px;... but it's not a great solution, so i have to resort to modifying your plugin, but i guess other users can benefit from such improvement. Even better if all shortcodes work in a responsive layout.
Reply
#14
That´s a good idea. I think it should be possible to choose % or pixel in the plugin for googlemap. Responsive website are almost standard. Sorry for my English...Smile

Big thanks
Reply
#15
I added a Padlet shortcode from original Padlet shortcode Wordpress plugin to list of supported shortcodes. Changed some code to make it work properly. Maybe someone is interested:

Original Wordpress plugin
Padlet site
Github

PHP Code:
function createWallwisherEmbedFrame($atts$content null) {
    
extract(shortcode_atts(array(
        
'key'   => '',
        
'width'   => '100%',
        
'height' => '480'
    
), $atts));

    if(!
$key) {
        
$code "<div style='padding:5px;border: 1px solid red'>Something is wrong with your Padlet shortcode.</div>";
    }
    else {
        
$code "<iframe src='http://padlet.com/embed/$key' frameborder=0 width='$width' height='$height' style='padding:0;margin:0;border:none'></iframe><div style='border-top:2px solid #a7d23a;padding:8px;margin:0;font-size:12px;text-align:right'><a href='http://wallwisher.com' style='color:#41555f;text-decoration:none'>Created with Padlet<img valign='middle' style='margin:0 0 0 10px;padding:0;border:none;width:16px;height:16px' src='http://padlet.com/favicon.ico'></a></div>";
    }

    
/**
    * Return embed in JS and iframe
    */
    
return $code;
}

add_shortcode('wallwisher''createWallwisherEmbedFrame''[wallwisher key="" height="" width="" /]');
add_shortcode('padlet''createWallwisherEmbedFrame''[padlet key="" height="" width="" /]'); 
Reply
#16
What has changed in last version (1.1)? I missed this.

Btw. plugin is not compattible with Updater plugin.
Reply
#17
I added directions support on googlemap shortcode...

I'm not updating any GS plugins at the moment due to other commitments, if someone wants to take ownership of any of them let me know....
My Github Repos: Github
Website: DigiMute
Reply
#18
Hi,

thanks a lot for this module.

just to another user, don't forget to modify shorcode in source code in your page either all space are transformed and the plugin can read correctly.
Reply
#19
FYI: This plugin only partly works in GS 3.4.0a. The shortcodes themselves work, but the dropdown menu doesn't show up in Ckeditor.
Reply
#20
If I get a chance over the next couple of days I'll update it.
My Github Repos: Github
Website: DigiMute
Reply
#21
#metadata_window no longer exists, I just readded a dummy to content tab, so this works now, not sure about other plugins that use js insertions like this. this slightly confusing, since meta is an actual tab now, and it uses to be options section. Now it is on content section, but it is useless on meta tab or options now since they are hidden
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)