Git Product home page Git Product logo

filemaker-data-api-wordpress's Introduction

WordPress FileMaker Data API integration

A WordPress plugin to integrate with the FileMaker Data API to allow data to be pulled from FileMaker and displayed easily in your WordPress site.

At this early stage of development only 'pull' is possible. Over time this plugin will be expanded to allow for data to be updated in FileMaker as well.

The primary means of 'pulling' data is through the use of two WordPress shortcodes

Installation

Download, copy to your plugins directory, enable, configure and you're ready to go.

Shortcodes

The two shortcodes listed below provide access to your FileMaker data.

[FM-DATA-TABLE]

Pull all records from the specified layout and generate a table of records.

Parameter Description Required
layout Specify the layout which data should be pulled from true
fields A list of the fields which should be included in the table. | separated (see example below) true
labels The labels to use for the column headers. If ommited then the field names (as above) are used instead. | separated false
types The type of each field. Currently supported are
  • Currency - displays a number in the selected currency (see the settings screen for locale selection)
  • Image, which can optionally be follwed by a hypehen and an integer value (e.g. Image-100) which will set the width to 100px (defaults to full size)
  • Thumbnail - as for image, however defaults to 50px
  • null - outputs the content of the field
false
id-field Which field on the layout acts as a primary key for the given layout false
detail-url If both this and the id-field are set then the content of the cells is converted to a link to the URL. You must provide the location in the URL which the value of id-field will be embded in using *id* e.g. detail-url="/product/?id=*id*" false
query The JSON encoded query to apply to the records selected in the form 'field': '{ operator } value'.

It is simplest to use single quotes for the JSON object, which will be transposed prior to submission to FM. e.g. query="{'Unit Price': '<500', 'Availability': 'In stock'}".

Note that depending on the exact Wordpress editor you're using then less than, and greater than signs may be html encoded. Again, the parser will cope with that. Also be aware that you're performing an AND query if you specify more than one key / value pair.
false

Example

 [FM-DATA-TABLE layout="Product Details" fields="Image|Part Number|Name|Unit Price|Category|Availability" types="Thumbnail-50|||Currency||" id-field="Part Number" detail-url="/product/?id=*id*" query="{'Unit Price': '<500', 'Availability': 'In stock'}"]

[FM-DATA-FIELD]

Display a single field value.

Parameter Description Required
layout Specify the layout which data should be pulled from true
id-field The field which contains the UUID to locate the correct record true
id The ID to search for in the above field. Either a static value, or this can be a special value URL-xxx in which case the query parameter xxx will be used. In the detail-url example above this would correspond to id, so it would be URL-id true
field The field to display true
type The type of output - options are the same as for the 'types' above. false

Examples

[FM-DATA-FIELD layout="Product Details" id-field="Part Number" id="URL-id" field="Image" type="Image-200"]
[FM-DATA-FIELD layout="Product Details" id-field="Part Number" id="23456" field="Price" type="Currency"]
[FM-DATA-FIELD layout="Product Details" id-field="Part Number" id="URL-id" field="Stock Level"]

TODO

  • More output types
  • Write data back to FM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.