I want to include some php content on a page. I know that I can do that with a snippet. But that's geared towards content that is reused across multiple pages. What if I just want the content on one page - is there an easier way to just slip it into the code on one of my pages?
Thanks.
Page 1 of 1
Basic Question: Is there a way to execute php code on a page without using a snippet? I want to include some php on one page. Not reuse it as with a snippet
#2
Posted 28 April 2009 - 11:08 PM
You can enable Embedded PHP in the Etomite configuration panel but that still won't help with Documents... You can then embed PHP in Templates or Chunks, and use it in Snippets, of course... Unfortunately, Documents are the one place where PHP cannot be embedded...
Tell us more about what you are attempting to do and I'm relatiely sure we can provide a workable solution...
Tell us more about what you are attempting to do and I'm relatiely sure we can provide a workable solution...
#3
Posted 29 April 2009 - 03:01 AM
Ralph, on Apr 28 2009, 06:08 PM, said:
You can enable Embedded PHP in the Etomite configuration panel but that still won't help with Documents... You can then embed PHP in Templates or Chunks, and use it in Snippets, of course... Unfortunately, Documents are the one place where PHP cannot be embedded...
Tell us more about what you are attempting to do and I'm relatiely sure we can provide a workable solution...
Tell us more about what you are attempting to do and I'm relatiely sure we can provide a workable solution...
Thank you for the reply.
Generally, what I am doing is creating a form that users can submit so that information is entered into the site's database. This is the form that I'm working on (it doesn't work yet): http://www.osdu.on.ca/index.php?id=80
I have one follow-up question: I want to have form verification javascript code to evaluate what's written in the form. Normally I put this in the document's <head>. But I'm not sure how to do that with this etomite site. What's the best way to solve that problem - must I create a specific template just for that page?
Thank you for your thoughts.
#4
Posted 29 April 2009 - 04:43 AM
P.S. I'm rather frustrated right now. Etomite is rewriting the code on my page. I don't know how to get it to do what I want.
Scenario: I want the following code to appear on my page (this is pseudo-code):
<form>
<table>
<inputs>
</table>
<table>
<more inputs>
</table>
<submit button>
</form>
Instead whenever I input that code into an etomite page and save it I get the following:
<form>
<table>
<inputs>
</table>
</form>
<table>
<more inputs>
</table>
<submit button>
In other words, the close form tag is inserted after the first table in the form but before the form submission button. As far as I know, this HTML markup is not incorrect since <form> is a block-level tag that can hodl other block-level tags such as <table>.
So, this rewrite of the code that I want breaks my form. How should I work around this do you think?
Grrrr....
Scenario: I want the following code to appear on my page (this is pseudo-code):
<form>
<table>
<inputs>
</table>
<table>
<more inputs>
</table>
<submit button>
</form>
Instead whenever I input that code into an etomite page and save it I get the following:
<form>
<table>
<inputs>
</table>
</form>
<table>
<more inputs>
</table>
<submit button>
In other words, the close form tag is inserted after the first table in the form but before the form submission button. As far as I know, this HTML markup is not incorrect since <form> is a block-level tag that can hodl other block-level tags such as <table>.
So, this rewrite of the code that I want breaks my form. How should I work around this do you think?
Grrrr....
#6
Posted 29 April 2009 - 08:51 AM
Etomite itself won't be rewriting your code, but if you are using one of the rich text editors that might be. they all have bugs.
Options:
1) disable the rich text editting for the page concerned and enter the page HTML directly.
2) put the form into a chunk and include the chunk in the page.
Options:
1) disable the rich text editting for the page concerned and enter the page HTML directly.
2) put the form into a chunk and include the chunk in the page.
#7
Posted 29 April 2009 - 01:22 PM
Personally, I NEVER code Forms directly within Documents... I hand code my forms in Chunks wich can also contain any Javascript validation code... I could never rely on a WYSIWYG editor to code my forms properly and can hand code much faster anyway... I simply place the Chunk call in the proper location within my documents...
Etomite does come with Tigra Form Validator (manager/media/tigra_form_validator/) and I use it all the time for initial form validations - or you can use your own code... Either way, it is important to remember that you still need to do Server-Side validation and sanitation because an end user could simply disable Javascript in their browser and send mailcious form data to your script...
Etomite does come with Tigra Form Validator (manager/media/tigra_form_validator/) and I use it all the time for initial form validations - or you can use your own code... Either way, it is important to remember that you still need to do Server-Side validation and sanitation because an end user could simply disable Javascript in their browser and send mailcious form data to your script...
#8
Posted 29 April 2009 - 04:42 PM
DeanC, on Apr 29 2009, 03:32 AM, said:
Disable the WYSIWYG editor for that page..
Or save it in a chunk and call it {{chunkName}} on the page that you are using the WYSIWYG editor on.
Or save it in a chunk and call it {{chunkName}} on the page that you are using the WYSIWYG editor on.
Ah, I didn't know about that check box to turn the WYSIWYG editor off. Thank you very much - that solves the issue : )
#9
Posted 29 April 2009 - 05:15 PM
Ralph - I haven't used the built-in form validator. I'll think about it next time I'm working on a project.
I feel that I'm done that form/project now. Thank you all for your assistance and suggestions - I feel that the supportive and encouraging etomite community makes me want to continue to learn about this CMS and use it in future projects : )
Cheers!
- Josh
I feel that I'm done that form/project now. Thank you all for your assistance and suggestions - I feel that the supportive and encouraging etomite community makes me want to continue to learn about this CMS and use it in future projects : )
Cheers!
- Josh
Page 1 of 1

Sign In
Register
Help
MultiQuote