Closed KhawarMehfooz closed 11 months ago
Usually the value of the page template is the filename.
If you go to the ACF UI and try to build the field group, set the location to Page Template, inspect the dropdown of page template values and see what ACF is using. Then just mimic that in your code. It might be something like google-analytics.php
. But checking what ACF itself would use is the best way to find out.
Here is an example on one of my projects. In my case I'd do:
->setLocation('page_template','==','views/template-custom.blade.php');
Thank you. It Worked.
Issue Description
The
setLocation('page_template', '==', 'template_name')
function in ACF does not seem to be working as expected. I have ensured that the template name is correct and matches exactly, including case sensitivity. However, the ACF fields associated with the specified page template are not displaying.Code Snippet
Video Preview
https://github.com/StoutLogic/acf-builder/assets/80300513/1b68fd59-eb42-4aba-803d-8839afc35ef4
Additional Details: