Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flexibleContent layouts split in separate files #188

Open
ugnius1994 opened this issue Oct 18, 2024 · 1 comment
Open

flexibleContent layouts split in separate files #188

ugnius1994 opened this issue Oct 18, 2024 · 1 comment

Comments

@ugnius1994
Copy link

Hey,

I want use flexibleContent field, but i want each Layout split in separate files. Can i do that?

`<?php

use StoutLogic\AcfBuilder\FieldsBuilder;

add_action('acf/init', function () {
$templatePageFields = new FieldsBuilder('flexible_content_template');

// Add a flexible content field
$templatePageFields
    ->addFlexibleContent('flexible_content_field', [
        'label' => 'Page Sections',
        'button_label' => 'Add Section',
    ]);

import here all sections



$templatePageFields
    ->endFlexibleContent()
    ->setLocation('page_template', '==', 'pages/global.php');

acf_add_local_field_group($templatePageFields->build());

});
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@ugnius1994 and others