Common settings examples

Quick links

To help you navigate through the common settings page, you can click on the links below to quickly access the settings you need.

The add-on is ready to connect to your MySQL database, SQL Server, and WordPress REST API.

CMS

WordPress (preconfigured by default)

1) Connect DB column names --> Indesign Tags (case sensitive):
post_title --> title
post_content --> text
#IMAGE --> image
image-caption --> caption
image-credit --> credit
(* Remember to delete the spaces on the right in the IDs).

2) SQL for posts list:
SQL Statement:
select ID,post_title from wp_posts where post_status = 'publish' order by post_date DESC LIMIT 100
Column title: post_title
Column Id: ID

3) SQL for one single post:
SQL Statement:
select post_title,post_content from wp_posts where ID=#ID
Column content: post_content
Javascript to clear text:
WordpressClear();
g_text_out = g_text_in;

4) SQL for image and caption of one single post:
SQL Statement:
select *,post_excerpt as 'image-caption',post_title as 'image-credit' from wp_postmeta, wp_posts where post_id = #ID and meta_key = '_thumbnail_id' and ID = meta_value
Column image ID: guid
Column image caption: image-caption
Column image credit: image-credit
Javascript to create URL to image:
g_str_url_image = g_id_image;

WordPress with custom fields

1) Connect DB column names --> Indesign Tags (case sensitive):
post_title --> title
post_content --> text
#IMAGE --> image
image-caption --> caption
image-credit --> credit
city --> city
author --> author
(* Remember to delete the spaces on the right in the IDs).

2) SQL for posts list:
SQL Statement:
select ID,post_title from wp_posts where post_status = 'publish' order by post_date DESC LIMIT 100
Column title: post_title
Column Id: ID

3) SQL for one single post:
SQL Statement:
select post_title,post_content,c1.meta_value as 'author',c2.meta_value as 'city'
from wp_posts
left join wp_postmeta c1 on c1.post_id= ID and c1.meta_key = 'Author'
left join wp_postmeta c2 on c2.post_id= ID and c2.meta_key = 'City'
where ID=#ID
Column content: post_content
Javascript to clear text:
WordpressClear();
g_text_out = g_text_in;

4) SQL for image and caption of one single post:
SQL Statement:
select *,post_excerpt as 'image-caption',post_title as 'image-credit' from wp_postmeta, wp_posts where post_id = #ID and meta_key = '_thumbnail_id' and ID = meta_value
Column image ID: guid
Column image caption: image-caption
Column image credit: image-credit
Javascript to create URL to image:
g_str_url_image = g_id_image;

WordPress REST API

We recommend using the database connection for better performance, but this is the alternative in case that is not possible.

Step 1. Create a New configuration and enter a Configuration name.

Step 2. Under Database Type, select WordPress REST API and leave the rest of the connection data blank (user, password, database, and server).

Step 3. Modify the SQL Statements like this:

Step 4. Click on the Save button.

WordPress REST API (WP site hosted on wordpress.com)

1) Connect DB column names --> Indesign Tags (case sensitive):
post_title --> title
post_content --> text
#IMAGE --> image
image-caption --> caption
image-credit --> credit
(* Remember to delete the spaces on the right in the IDs).

2) SQL for posts list:
SQL Statement:
https://public-api.wordpress.com/wp/v2/sites/yoursite.wordpress.com/posts?per_page=100
Column title: post_title
Column Id: ID

3) SQL for one single post:
SQL Statement:
https://public-api.wordpress.com/wp/v2/sites/yoursite.wordpress.com/posts?include[]=#ID
Column content: post_content
Javascript to clear text:
WordpressClear();
g_text_out = g_text_in;

4) SQL for image and caption of one single post:
SQL Statement:
https://public-api.wordpress.com/wp/v2/sites/yoursite.wordpress.com/posts?include[]=#ID&_embed
Column image ID: guid
Column image caption: image-caption
Column image credit: image-credit
Javascript to create URL to image:
g_str_url_image = g_id_image;

WordPress REST API (self-hosted WP site)

1) Connect DB column names --> Indesign Tags (case sensitive):
post_title --> title
post_content --> text
#IMAGE --> image
image-caption --> caption
image-credit --> credit
(* Remember to delete the spaces on the right in the IDs).

2) SQL for posts list:
SQL Statement:
https://yourdomain.com/wp-json/wp/v2/posts?per_page=100
Column title: post_title
Column Id: ID

3) SQL for one single post:
SQL Statement:
https://yourdomain.com/wp-json/wp/v2/posts?include[]=#ID
Column content: post_content
Javascript to clear text:
WordpressClear();
g_text_out = g_text_in;

4) SQL for image and caption of one single post:
SQL Statement:
https://yourdomain.com/wp-json/wp/v2/posts?include[]=#ID&_embed
Column image ID: guid
Column image caption: image-caption
Column image credit: image-credit
Javascript to create URL to image:
g_str_url_image = g_id_image;

Drupal

1) Connect DB column names --> Indesign Tags (case sensitive):
post_title --> title
post_content --> text
#IMAGE --> image
image-caption --> caption
image-credit --> credit
(* Remember to delete the spaces on the right in the IDs).

2) SQL for posts list:
SQL Statement:
SELECT nid,title FROM node where type = 'article' and status=1 order by created DESC LIMIT 100
Column title: title
Column Id: nid

3) SQL for one single post:
SQL Statement:
SELECT nr.nid, nr.vid, fb.body_value as 'post_content', n.title as 'post_title'
FROM node n, node_revision nr
JOIN field_data_body fb ON nr.vid = fb.revision_id
WHERE nr.nid = n.nid and n.nid = #ID
Column content: post_content
Javascript to clear text:
WordpressClear();
g_text_out = g_text_in;

4) SQL for image and caption of one single post:
SQL Statement:
SELECT f.uri as 'guid', fi.field_image_alt as 'image-caption', field_image_title as 'image-credit'
FROM file_managed f, file_usage fu, field_data_field_image fi
WHERE fi.entity_id = #ID and fu.fid = fi.field_image_fid and f.fid = fu.fid
Column image ID: guid
Column image caption: image-caption
Column image credit: image-credit
Javascript to create URL to image:
g_id_image = g_id_image.split("public://").join("");
g_id_image = "https://yourdomain.com/sites/default/files/styles/large/public/" + g_id_image;
g_str_url_image = g_id_image;



E-COMMERCE

WooCommerce

1) Connect DB column names --> Indesign Tags (case sensitive):
post_title --> title
post_content --> text
#IMAGE --> image
str_price --> price
(* Remember to delete the spaces on the right in the IDs).

2) SQL for posts list:
SQL Statement:
select ID,post_title from wp_posts where post_status = 'publish' and post_type = 'product' order by post_date DESC
Column title: post_title
Column Id: ID

3) SQL for one single post:
SQL Statement:
select post_title,post_content, CONCAT(FORMAT(m1.meta_value, 2),' €') as str_price from wp_posts,wp_postmeta m1 where ID=#ID and m1.post_id = ID and m1.meta_key = '_regular_price'
Column content: post_content
Javascript to clear text:
WordpressClear();
g_text_out = g_text_in;

4) SQL for image and caption of one single post:
SQL Statement:
select * from wp_postmeta, wp_posts where post_id = #ID and meta_key = '_thumbnail_id' and ID = meta_value
Column image ID: guid
Column image caption:
Javascript to create URL to image:
g_str_url_image = g_id_image;

Prestashop

1) Connect DB column names --> Indesign Tags (case sensitive):
post_title --> title
post_content --> text
#IMAGE --> image
str_price --> price
(* Remember to delete the spaces on the right in the IDs).

2) SQL for posts list:
SQL Statement:
SELECT p.id_product as 'id_product', pl.name as 'name' FROM psizi_product p
LEFT JOIN psizi_product_lang pl ON p.id_product = pl.id_product and pl.id_lang = 1
Column title: name
Column Id: id_product

3) SQL for one single post:
SQL Statement:
SELECT pl.name as title,CONCAT(FORMAT(p.price, 2),'€') as str_price,pl.description
FROM psizi_product p
LEFT JOIN psizi_product_lang pl ON p.id_product = pl.id_product and pl.id_lang = 1
where p.id_product=#ID
Column content: description
Javascript to clear text:
WordpressClear();
g_text_out = g_text_in;

4) SQL for image and caption of one single post:
SQL Statement:
select concat('https://www.yourdomain.com/', im.id_image, '-large_default/', pp.reference,'.jpg') as image_url
from psizi_product pp
join psizi_image im on (im.id_product = pp.id_product)
where pp.id_product = #ID and im.cover = 1
Column image ID: image_url
Column image caption:
Javascript to create URL to image:
g_str_url_image = g_id_image;