• Resolved peterbrent

    (@peterbrent)


    I like to use ACF Extended in Oxygen.

    I have a Flexible Content Field in ACF and want to assign the there called “layouts” to templates of Oxygen to style these Layouts.
    But I can’t get it to work.

    It looks like ACF Extended wants to assign templates from the wordpress theme to these layouts, but this is disabled by Oxygen. So it’s the wrong path. I even don’t know where the templates of Oxygen are located.
    Please can someone help?

    • This topic was modified 2 years, 11 months ago by peterbrent.
Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback! Unfortunately I’m not an Oxygen user, so I can’t really provide support for that plugin. You can try to reach the Oxygen support and ask them how their templating system works, it might help.

    Regarding the Flexible Content Dynamic Render of ACF Extended, the layouts path setting will try to find the file in the following folders:

    • /wp-content/themes/child-theme/
    • /wp-content/themes/parent-theme/
    • /wp-content/
    • /

    For example in the following screenshot, I’ve set the layout to templates/layout.php, so the system will try to find it in:

    • /wp-content/themes/child-theme/templates/layout.php
    • /wp-content/themes/parent-theme/templates/layout.php
    • /wp-content/templates/layout.php
    • /templates/layout.php

    In your case, since you don’t have any theme, you could enter plugins/my-plugin/layout.php and the system will find it using the third location rule:

    /wp-content/plugins/my-plugin/layout.php
    

    The prefix you see in the UI on the screenshot, “/wp-content/themes/blank/”, is just a visual hint for the developer, in reality, the system will actually look in all the locations I listed above.

    If you would like to customize that visual prepend, you can use the acfe/flexible/prepend/template filter. See documentation.

    You can also set the template path directly within PHP if you prefer, using the acfe/flexible/render/template hook. See documentation.

    As a side note, this behavior is the same for the Block Types UI and is described on this Oxygen community website. Hooks are just different.

    Once you correctly set the path and the layout is correctly found, you’ll then have to write the code in the layout, as described in the documentation here.

    Hope it helps!

    Have a nice day!

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Flexible Content Layouts assigning to Oxygen templates’ is closed to new replies.