My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Shortcode  
Shortcode Reference
Featured, Phase-Deploy
Updated Sep 3, 2009 by codex.is.poetry

gdocs

TypeRequired AttributesOptional Attributes
Documenttype, idstyle
Spreadsheettype, st_id, wt_idstyle, headings, sort
Celltype, st_id, wt_id, cell_idstyle

General syntax:

[gdocs]default text[/gdocs]

Wordpress will parse the above shortcode and pass the attributes to the plugin. If the plugin fails to retrieve the document/spreadsheet from Google, it will display the text within the gdocs tags. Note that there must be at least one space between shortcodes.

Examples

<!-- Embedding a Google Document -->
I want my document to appear in between this line
[gdocs type='document' id='ddk7f9g2_15g3w6q9fk']OOPS... [/gdocs]
and this line.
<!-- The string "OOPS... " will be displayed in event of failure -->

results in the following:

Add classes to the documents this way:

<!-- Styling a Google Document -->
I want my document to appear in between this line
[gdocs type='document' id='ddk7f9g2_15g3w6q9fk' style='x, y, z']
and this line.

results in

<div id="gdocs_ddk7f9g2_15g3w6q9fk" class="gdocs x y z">
  <!-- Content from Google Document -->
  <h4 style="color: rgb(11, 83, 148);">HI! I am a <span style="background-color: rgb(255, 153, 0);">Google</span> Document.</h4><br/>
</div>

Attributes

type

Required

enum document|spreadsheet

Indicates the type of file to embed.

[gdocs type='document' ...]
[gdocs type='spreadsheet' ...]

id

Required for Documents

string

Google generated document ID. Available at plugin configuration page.

[gdocs id='ddk7f9g2_15g3w6q9fk' ...]

st_id

Required for Spreadsheets

string

Google generated spreadsheet ID. Available at plugin configuration page.

[gdocs st_id='ddk7f9g2_15g3w6q9fk' ...]

wt_id

Required for Spreadsheets

string

Google generated worksheet ID. Available at plugin configuration page.

[gdocs wt_id='od6' ...]

cell_id

Required for cells

string R<row>C<col>

Cell coordinates in the worksheet. Specify in the form R<row>C<col>. For example, the following

[gdocs cell_id='R2C2' ...]

displays the cell in the second row and second column of the specified worksheet.

headings

comma-separated values

Custom column headings to display in tables. These will replace the headings retrieved from Google. Headings are replaced from left to right, i.e. if there are 4 columns and you provide only 3 values, the 4th column heading will not be replaced.

[gdocs headings='First, Second, Third' type='spreadsheet' ...]

results in

<!-- Embedded worksheet -->
<thead>
  <tr>
    <th>First</th>
    <th>Second</th>
    <th>Third</th>
    <th>cxh4</th>    <!-- Not replaced -->
  </tr>
</thead>

sort

string true | <javascript variable>

Specifies parameters for tablesorter.

To use tablesorter with the default options, set sort to true in your shortcode, as follows:

[gdocs sort="true" ...]

To use tablesorter with custom options, include the parameters within braces in the sort attribute:

[gdocs sort="{cancelSelection:false}" ...]

Certain characters, such as square brackets, will confuse the shortcode parser. If you have complex parameters, pass them through a Javascript variable, as follows:

<script type='text/javascript'>
  var properties = {cancelSelection:false, sortList:[[1,1]]};
</script>
[gdocs sort="properties" ...]

tablesorter ConfigurationĀ»

style

comma-separated values

Specifies CSS classes for documents and spreadsheets. If a corresponding stylesheet is found in inline-google-docs/styles/, it will be imported via a <link> tag.

For example,

[gdocs style='x, y, nice' ...]

If the plugin locates a readable file inline-google-docs/styles/nice.css or inline-google-docs/styles/nice/nice.css, the file will be imported into the HTML page. Furthermore, the DIV or TABLE element housing the Google Document or Spreadsheet will be given these values as classes.

<div id="..." class="gdocs x y nice">
Comment by firebir...@gmail.com, Nov 4, 2009

For cell_id, is there a way to specify a range?

Comment by project member codex.is.poetry, Nov 5, 2009

unfortunately, no.

Comment by vivisect...@gmail.com, Jan 22, 2010

Is there a way to hide columns?

Comment by reg...@gmail.com, May 27, 2010

Is there a way to display an entire column?


Sign in to add a comment
Powered by Google Project Hosting