yxcx
This commit is contained in:
@@ -287,10 +287,15 @@
|
||||
log('PLACEHOLDER INFO', 'Keine Tabellen – DB Placeholder Block wird nicht angezeigt.', '#888');
|
||||
return;
|
||||
}
|
||||
const firstTable = tables[0] || {};
|
||||
const tableName = firstTable.name || 'tabelle';
|
||||
const columns = Array.isArray(firstTable.columns) ? firstTable.columns : [];
|
||||
const firstColumn = columns.length ? columns[0].name : 'feld';
|
||||
const placeholderLabel = `${tableName}.${firstColumn}`.toUpperCase();
|
||||
addOnce(bm, 'cust-placeholder-db', {
|
||||
id: 'cust-placeholder-db',
|
||||
label: '🗄️ Placeholder (DB)',
|
||||
content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="database" data-placeholder-table="${tables[0].name}" data-placeholder-column="${tables[0].columns?.[0]?.name || ''}">{{${(tables[0].name + '.' + (tables[0].columns?.[0]?.name || '')).toUpperCase()}}}</span>`
|
||||
content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="database" data-placeholder-table="${tableName}" data-placeholder-column="${firstColumn}">{{${placeholderLabel}}}</span>`
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
Reference in New Issue
Block a user