Code after ending html tag?
I have a php script that I'd like to add to XDPX9 and it requires me to insert a line of code after the ending html tag. I'd like to do this from within xara and not after exporting the html. Can this be done with a special name tag and placeholder?
Thanks
Re: Code after ending html tag?
Not that I am aware of but I am sure one of the members who are more savvy with HTML will have a suggestion.
Re: Code after ending html tag?
Not tested this but it should work, maybe...
Put this in a placeholder at the bottom of your page:
Code:
<!-- I added this -->
</div>
</div>
</div>
<!--[if lt IE 7]><script type="text/javascript" src="index_htm_files/png.js"></script><![endif]-->
</body>
</html>
<?php
// your php script here
?>
<?php
//everything below will be ignored by the browser
// end of I added this
Since the closing PHP tag in your placeholder is missing,the closing HTML inserted automatically by Xara is ignored by the browser.
Just make sure the number of closing DIVs you put in your placeholder match the number created by Xara.
:thx
Re: Code after ending html tag?
Thanks for the suggestion! I'm definitely going to play around with this. I never even thought of doing something like that :)
Re: Code after ending html tag?
Similar to Franks suggestion but instead of using a placeholder you can try using Web Properties and put similar code as below into HTML Code (body) and you shouldn't need to worry about the closing divs for placeholders.
Code:
</body>
</html>
my code after html here
<?php
or my php code here
// exit will stop rest of exported page being executed/outputted ie. xaras default </body></html>
exit;
?>