Title: Flexible external render path
Last modified: April 11, 2020

---

# Flexible external render path

 *  Resolved [Aristide](https://wordpress.org/support/users/abruneau0/)
 * (@abruneau0)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/flexible-external-render-path/)
 * Hi and thanks for your extensive work on this great plugin.
 * I’m trying to get the external render for the Flexible field and I work with 
   Oxygen Builder, which is a themeless page builder.
    In my quest to get it working,
   I found [this link](https://wpdevdesign.com/changing-the-template-path-to-a-plugin-for-acf-extended-block-types-ui/?fbclid=IwAR0HhUi9J7AvbLJHgRrQb2cz3ZipFnn-UzPExp5W70nIqaTIDwAn4LGFEqI)
   that give me the control of the root file for my different templates. The hook
   works great, as it updates the prefix on render fields inside my Flexible. Changing`/
   wp-content/themes/twentynineteen` to `https://www.website.com/wp-content/block/`.
 * But I can get it to display anything (neither php, or css, which the one I tested)
   
   I follow [your page](https://www.acf-extended.com/post/flexible-content-dynamic-layout-preview)
   as close as possible, but I’m afraid there is a naming convention of some sort
   I’m not aware off.
 * The function `...the_flexible('flexFieldName');...` appears to be outputing well,
   as I can see the Block name as comment inside the rendered HTML.
 * [Here is a attached screenshot](https://imgur.com/a/3X1tZvv) of my current flexible
   render path configuration.
 * To sum up naming I used :
    - Flexible field name : ‘flex-project’
    - Flexible layout : ‘flexible_photo’
    - Path to PHP : /flex-project/flexible_photo/template.php
    - Path to CSS : /flex-project/flexible_photo/style.css
 * Are thoses correct ?
 * I hope I’m clear enough, and will be happy to share more informations !
    Thanks
   in advance for your help.
 * Aristide
    -  This topic was modified 6 years, 1 month ago by [Aristide](https://wordpress.org/support/users/abruneau0/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/flexible-external-render-path/#post-12686226)
 * Hello,
 * Thanks for the feedback. I think there’s a misundertanding here, because the 
   tutorial you linked is about the ACF Block Type feature (which has an UI in ACF
   Extended). In your question you’re talking about the Flexible Content: Dynamic
   Render, which is an another feature.
 * Flexible Content: Dynamic Render feature use `locate_template()` to include a
   template files, but before that, it checks if the file exists first.
 * You can take advantage of available hooks here. You’ll find some examples in 
   the [FAQ section here](https://wordpress.org/plugins/acf-extended/#how%20to%20change%20the%20flexible%20content%3A%20layout%20render%20paths%20in%20php%3F).
 * For what you need, you can probably use the following code:
 *     ```
       // Add custom prefix path for all Flexible Content Layouts Templates
       add_filter('acfe/flexible/render/template', 'acf_flexible_content_change_template', 10, 4);
       function acf_flexible_content_change_template($template, $field, $layout, $is_preview){
   
           return ABSPATH . '/wp-content/plugins/my-plugins/layouts/' . $template;
   
       }
   
       // Add custom prefix URL for all Flexible Content Layouts Style files
       add_filter('acfe/flexible/render/style', 'acf_flexible_content_change_style', 10, 4);
       function acf_flexible_content_change_style($style, $field, $layout, $is_preview){
   
           return home_url() . '/wp-content/plugins/my-plugins/layouts/' . $style;
   
       }
   
       // Add custom prefix URL for all Flexible Content Layouts Scripts files
       add_filter('acfe/flexible/render/script', 'acf_flexible_content_change_script', 10, 4);
       function acf_flexible_content_change_script($script, $field, $layout, $is_preview){
   
           return home_url() . '/wp-content/plugins/my-plugins/layouts/' . $script;
   
       }
       ```
   
 * Hope it helps!
 * have a nice day.
 * Regards.
 *  Thread Starter [Aristide](https://wordpress.org/support/users/abruneau0/)
 * (@abruneau0)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/flexible-external-render-path/#post-12688227)
 * Hey and thanks for your answer, it helps a lot !
 * I just tried the code you share, and everything seems to work !
 * Apart from the ‘prefixs’ inside the flexible field configuration, which still
   display the theme path, but PHP, CSS and JS files load well !
 * Thanks again ! I’ll keep an eye on the post if you have a solution to display
   the right path prefix, but that’s not mandatory for me to start working on it
   😉
 * Have a nice day too
    Regards

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Flexible external render path’ is closed to new replies.

 * ![](https://ps.w.org/acf-extended/assets/icon-256x256.png?rev=2071550)
 * [Advanced Custom Fields: Extended](https://wordpress.org/plugins/acf-extended/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-extended/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-extended/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-extended/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-extended/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-extended/reviews/)

## Tags

 * [Flexible](https://wordpress.org/support/topic-tag/flexible/)
 * [path](https://wordpress.org/support/topic-tag/path/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [render](https://wordpress.org/support/topic-tag/render/)

 * 2 replies
 * 2 participants
 * Last reply from: [Aristide](https://wordpress.org/support/users/abruneau0/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/flexible-external-render-path/#post-12688227)
 * Status: resolved