asdasd
This commit is contained in:
@@ -156,6 +156,9 @@
|
||||
|
||||
// NEU: Generische Fetch-Funktion für jeden Ressourcentyp ('kind')
|
||||
B.fetchResource = (kind) => {
|
||||
if (B.USE_DYNAMIC_SECTIONS && ['templates','sections','blocks','snippets'].includes(String(kind || '').toLowerCase())) {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
if (!shouldLoad(kind)) {
|
||||
log('BLOCKED', `Blockiert: ${kind} (Modus: ${B.EDITOR_MODE})`, '#708090', 'info');
|
||||
return Promise.resolve([]);
|
||||
@@ -183,7 +186,10 @@
|
||||
const loadDynamic = async () => {
|
||||
const sections = await resolveAllowedSections();
|
||||
B.ALLOWED_SECTION_SLUGS = sections.map(s => String(s.slug || '').toLowerCase());
|
||||
if (!sections.length) return [];
|
||||
if (!sections.length) {
|
||||
bm.remove(PLACEHOLDER_ID);
|
||||
return [];
|
||||
}
|
||||
const promises = sections.map(section =>
|
||||
fetchData('content', 'list', { section_id: section.id })
|
||||
.then(items => (Array.isArray(items) ? items : []).map(i => ({
|
||||
@@ -209,6 +215,7 @@
|
||||
|
||||
if (filtered.length === 0) {
|
||||
log('NO DATA', 'Keine API-Daten gefunden.', 'orange', 'warn', true);
|
||||
bm.remove(PLACEHOLDER_ID);
|
||||
} else {
|
||||
filtered.forEach(item => {
|
||||
const blockId = `lib-${item.kind}-${item.id}`;
|
||||
|
||||
Reference in New Issue
Block a user