generated from pascalmartineau/wp-skeleton
feat: Initial TheSections
This commit is contained in:
@@ -77,6 +77,7 @@ __( "MRC", 'ccat' );
|
|||||||
__( "Media type", 'ccat' );
|
__( "Media type", 'ccat' );
|
||||||
__( "Media(s)", 'ccat' );
|
__( "Media(s)", 'ccat' );
|
||||||
__( "Membership type", 'ccat' );
|
__( "Membership type", 'ccat' );
|
||||||
|
__( "Membership(s)", 'ccat' );
|
||||||
__( "Message", 'ccat' );
|
__( "Message", 'ccat' );
|
||||||
__( "Minimum price", 'ccat' );
|
__( "Minimum price", 'ccat' );
|
||||||
__( "Moral entity", 'ccat' );
|
__( "Moral entity", 'ccat' );
|
||||||
@@ -139,6 +140,7 @@ __( "URI", 'ccat' );
|
|||||||
__( "URL", 'ccat' );
|
__( "URL", 'ccat' );
|
||||||
__( "Universal access", 'ccat' );
|
__( "Universal access", 'ccat' );
|
||||||
__( "Upcoming", 'ccat' );
|
__( "Upcoming", 'ccat' );
|
||||||
|
__( "User Profile", 'ccat' );
|
||||||
__( "Virtual location", 'ccat' );
|
__( "Virtual location", 'ccat' );
|
||||||
__( "Where", 'ccat' );
|
__( "Where", 'ccat' );
|
||||||
__( "Wordless", 'ccat' );
|
__( "Wordless", 'ccat' );
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
"class": "",
|
"class": "",
|
||||||
"id": ""
|
"id": ""
|
||||||
},
|
},
|
||||||
|
"acfe_flexible_advanced": 0,
|
||||||
"layouts": {
|
"layouts": {
|
||||||
"layout_6852f761e95b0": {
|
"layout_6852f761e95b0": {
|
||||||
"key": "layout_6852f761e95b0",
|
"key": "layout_6852f761e95b0",
|
||||||
@@ -38,18 +39,7 @@
|
|||||||
"id": ""
|
"id": ""
|
||||||
},
|
},
|
||||||
"default_value": "",
|
"default_value": "",
|
||||||
"allow_in_bindings": 0,
|
|
||||||
"tabs": "all",
|
|
||||||
"toolbar": "full",
|
|
||||||
"media_upload": 1,
|
|
||||||
"delay": 0,
|
|
||||||
"show_in_graphql": 1,
|
|
||||||
"graphql_description": "",
|
|
||||||
"graphql_field_name": "content",
|
|
||||||
"graphql_non_null": 0,
|
|
||||||
"acfe_wysiwyg_auto_init": 0,
|
|
||||||
"acfe_wysiwyg_height": 300,
|
"acfe_wysiwyg_height": 300,
|
||||||
"acfe_wysiwyg_min_height": 300,
|
|
||||||
"acfe_wysiwyg_max_height": "",
|
"acfe_wysiwyg_max_height": "",
|
||||||
"acfe_wysiwyg_valid_elements": "",
|
"acfe_wysiwyg_valid_elements": "",
|
||||||
"acfe_wysiwyg_custom_style": "",
|
"acfe_wysiwyg_custom_style": "",
|
||||||
@@ -61,6 +51,18 @@
|
|||||||
"acfe_wysiwyg_transparent": 0,
|
"acfe_wysiwyg_transparent": 0,
|
||||||
"acfe_wysiwyg_merge_toolbar": 0,
|
"acfe_wysiwyg_merge_toolbar": 0,
|
||||||
"acfe_wysiwyg_custom_toolbar": 0,
|
"acfe_wysiwyg_custom_toolbar": 0,
|
||||||
|
"required_message": "",
|
||||||
|
"allow_in_bindings": 0,
|
||||||
|
"tabs": "all",
|
||||||
|
"toolbar": "full",
|
||||||
|
"media_upload": 1,
|
||||||
|
"delay": 0,
|
||||||
|
"show_in_graphql": 1,
|
||||||
|
"graphql_description": "",
|
||||||
|
"graphql_field_name": "content",
|
||||||
|
"graphql_non_null": 1,
|
||||||
|
"acfe_wysiwyg_auto_init": 0,
|
||||||
|
"acfe_wysiwyg_min_height": 300,
|
||||||
"acfe_wysiwyg_toolbar_buttons": []
|
"acfe_wysiwyg_toolbar_buttons": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -85,8 +87,7 @@
|
|||||||
"show_in_graphql": 1,
|
"show_in_graphql": 1,
|
||||||
"graphql_description": "",
|
"graphql_description": "",
|
||||||
"graphql_field_name": "sections",
|
"graphql_field_name": "sections",
|
||||||
"graphql_non_null": 0,
|
"graphql_non_null": 1,
|
||||||
"acfe_flexible_advanced": false,
|
|
||||||
"acfe_flexible_stylised_button": false,
|
"acfe_flexible_stylised_button": false,
|
||||||
"acfe_flexible_hide_empty_message": false,
|
"acfe_flexible_hide_empty_message": false,
|
||||||
"acfe_flexible_empty_message": "",
|
"acfe_flexible_empty_message": "",
|
||||||
@@ -149,5 +150,5 @@
|
|||||||
"graphql_types": "",
|
"graphql_types": "",
|
||||||
"acfe_meta": "",
|
"acfe_meta": "",
|
||||||
"acfe_note": "",
|
"acfe_note": "",
|
||||||
"modified": 1757960606
|
"modified": 1758554756
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
fragment ThePage on Page {
|
fragment ThePage on Page {
|
||||||
title
|
title
|
||||||
|
groupPostPage {
|
||||||
|
sections {
|
||||||
|
...TheSection
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ defineProps<{ node: ThePageFragment }>();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<UPage>
|
<UPage>
|
||||||
<UPageSection v-if="node.title" :title="node.title" />
|
<TheSections :sections="node.groupPostPage?.sections" />
|
||||||
</UPage>
|
</UPage>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fragment SectionTextBlock on GroupAbstractBuilderSectionsTextBlockLayout {
|
||||||
|
content
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { SectionTextBlockFragment } from "#graphql-operations";
|
||||||
|
|
||||||
|
defineProps<SectionTextBlockFragment>();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section data-section-type="text-block">
|
||||||
|
<div v-html="content" />
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fragment TheSection on GroupAbstractBuilderSections_Layout {
|
||||||
|
fieldGroupName
|
||||||
|
... on GroupAbstractBuilderSectionsTextBlockLayout {
|
||||||
|
...SectionTextBlock
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { TheSectionFragment } from "#graphql-operations";
|
||||||
|
|
||||||
|
const props = defineProps<{ sections: (TheSectionFragment)[] }>();
|
||||||
|
const sections = props.sections.map(useSection);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<component :is="component" v-for="({ component, attrs }, i) in sections" :key="i" v-bind="attrs" />
|
||||||
|
</template>
|
||||||
12
wp-content/themes/ccat/app/composables/useSection.ts
Normal file
12
wp-content/themes/ccat/app/composables/useSection.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import type { SectionTextBlockFragment, TheSectionFragment } from "#graphql-operations";
|
||||||
|
import { SectionTextBlock } from "#components";
|
||||||
|
|
||||||
|
export function useSection(section: TheSectionFragment) {
|
||||||
|
const { fieldGroupName, ...attrs } = section;
|
||||||
|
switch (fieldGroupName) {
|
||||||
|
case "GroupAbstractBuilderSectionsTextBlockLayout":
|
||||||
|
return { component: SectionTextBlock, attrs: attrs as SectionTextBlockFragment };
|
||||||
|
default:
|
||||||
|
throw createError({ statusCode: 500, statusMessage: "Erreur interne", message: "Type de section invalide" });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6659,7 +6659,7 @@ type GroupAbstractBuilder implements AcfFieldGroup & AcfFieldGroupFields & Group
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -6669,7 +6669,7 @@ type GroupAbstractBuilderSectionsTextBlockLayout implements AcfFieldGroup & AcfF
|
|||||||
"""
|
"""
|
||||||
Field of the "wysiwyg" Field Type added to the schema as part of the "GroupAbstractBuilderSectionsTextBlockLayout" Field Group
|
Field of the "wysiwyg" Field Type added to the schema as part of the "GroupAbstractBuilderSectionsTextBlockLayout" Field Group
|
||||||
"""
|
"""
|
||||||
content: String
|
content: String!
|
||||||
|
|
||||||
"""The name of the field group"""
|
"""The name of the field group"""
|
||||||
fieldGroupName: String @deprecated(reason: "Use __typename instead")
|
fieldGroupName: String @deprecated(reason: "Use __typename instead")
|
||||||
@@ -6682,7 +6682,7 @@ interface GroupAbstractBuilderSectionsTextBlockLayout_Fields implements AcfField
|
|||||||
"""
|
"""
|
||||||
Field of the "wysiwyg" Field Type added to the schema as part of the "GroupAbstractBuilderSectionsTextBlockLayout" Field Group
|
Field of the "wysiwyg" Field Type added to the schema as part of the "GroupAbstractBuilderSectionsTextBlockLayout" Field Group
|
||||||
"""
|
"""
|
||||||
content: String
|
content: String!
|
||||||
|
|
||||||
"""The name of the field group"""
|
"""The name of the field group"""
|
||||||
fieldGroupName: String @deprecated(reason: "Use __typename instead")
|
fieldGroupName: String @deprecated(reason: "Use __typename instead")
|
||||||
@@ -6706,7 +6706,7 @@ interface GroupAbstractBuilder_Fields implements AcfFieldGroup & AcfFieldGroupFi
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -7317,7 +7317,7 @@ type GroupPostArticle implements AcfFieldGroup & AcfFieldGroupFields & GroupAbst
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -7330,7 +7330,7 @@ interface GroupPostArticle_Fields implements AcfFieldGroup & AcfFieldGroupFields
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -8131,7 +8131,7 @@ type GroupPostPage implements AcfFieldGroup & AcfFieldGroupFields & GroupAbstrac
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -8144,7 +8144,7 @@ interface GroupPostPage_Fields implements AcfFieldGroup & AcfFieldGroupFields &
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -8183,7 +8183,7 @@ type GroupPostProject implements AcfFieldGroup & AcfFieldGroupFields & GroupAbst
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -8248,7 +8248,7 @@ interface GroupPostProject_Fields implements AcfFieldGroup & AcfFieldGroupFields
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -8625,7 +8625,7 @@ type GroupPostTemplate implements AcfFieldGroup & AcfFieldGroupFields & GroupAbs
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -8638,7 +8638,7 @@ interface GroupPostTemplate_Fields implements AcfFieldGroup & AcfFieldGroupField
|
|||||||
"""
|
"""
|
||||||
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
Field of the "flexible_content" Field Type added to the schema as part of the "GroupAbstractBuilder" Field Group
|
||||||
"""
|
"""
|
||||||
sections: [GroupAbstractBuilderSections_Layout]
|
sections: [GroupAbstractBuilderSections_Layout]!
|
||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user