Forum
How to use php script in .html (navigation template) page
Hi I want to use my perch syntax (<?php perch_content('Fonts color');?>) in the html page. I have already included ".htaccess" ( AddType application/x-httpd-php .php .htm .html ) file at the root of the folder but when I run the project and inspect the code, it shows as it is, as written php script in the html page.
One of the fundamental ideas behind Perch is that you can't use PHP in your Perch templates. https://docs.grabaperch.com/perch/getting-started/fundamentals/
In this instance, I'm assuming "navigation template" means a .html file that is being passed into a perch_pages_navigation function (or similar)?
You can pass the value into your template https://docs.grabaperch.com/templates/passing-variables-into-templates/
What I am trying to do is to pass the color code value for in-line css in the template so that the color of the font can be controlled from perch admin panel.
Drew's suggestion should work for that, or take a look at Page Attributes in the docs. https://docs.grabaperch.com/functions/page-attributes/
I am using the below syntax
and using the below syntax in navigation template
But this is not reflecting the color functionality on my site. On inspecting the code in developer mode I am getting the following html tag
Where you have perch:content in your template, try changing that to perch:pages
Thanks for your valuable support. Now I am getting this html code in inspect window (developer mode). Here you can see "" string is getting appended before the color code value.
I would think you would now need to check the template that is being used by the "Fonts colour" region - make sure there's nothing there that is adding

Otherwise, check the value stored in the region - is there a possibility of a copy/paste mistake?