Can you run php code within an ez-page?
I added some code but it keeps getting commented out.
turns intoCode:<?phpThanksCode:<!--?php
Can you run php code within an ez-page?
I added some code but it keeps getting commented out.
turns intoCode:<?phpThanksCode:<!--?php
In general, you cannot run php in an EZpage, because the CONTENT of EZPages is stored in the database, not in the file system. As the sequence of output assembly is important in PHP, it would have "run its course" before the database content is parsed into the output.
It's kinda a "cart before the horse" situation.
There IS an over-ride - and it has been discussed before on the forum, so try look for it.
Additionally, you could try either switching OFF your CK Editor while you work on source-type coding, or you could "toggle" to source mode, and SAVE without toggling back to wysiwyg.
But you will probably still need the over-ride technique first...
20 years a Zencart User
Thank you for the quick reply.
I have had luck using php code in a "Define Page", ie; page_2.php. What is the process for adding additional Define Pages? page_5.php, etc...
Define pages are FILE BASED (not stored in the database like EZpages are).
20 years a Zencart User
I can find page_2.php defined in three locations:
/includes/templates/default_template/templages
/includes/languages/english/html_includes/
/includeslanguages/english/MY_TEMPLATE/
I have copied and renamed to page_5.php, but it is not picking it up. I think I must be missing a page somewhere.
There is a technique to creating and/or re-naming the define pages. I do not use these extra pages any more, so I've forgotten the procedure, but there are lots of posts about how you do this, and I think there is also a Tutorial/FAQ topic on it.
20 years a Zencart User
Remember also to follow the principles of the OVER-RIDE system
You will always need a DEFAULT define page in the ROOT html_includes folder
\includes\languages\english\html_includes\
(In here you will see all the CORE define_page_xxxx.php files)
Then, you need an OVER-RIDE for each and every one, in the OVER-RIDE folder:
\includes\languages\english\html_includes\YOUR_TEMPLATE_FOLDER\
20 years a Zencart User