tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/347-how-do-i-use-php-inside-a-xml-blockCascade CMS: Discussion 2018-10-18T20:36:11Ztag:help-archives.hannonhill.com,2010-02-09:Comment/54992832011-02-22T04:39:00Z2011-02-22T04:39:01ZHow do I use PHP inside a XML block?<div><p>I have a page that is using a separate file Format for .xsl
style and a separate file Block for xml data. How can I invoke
PHP?</p>
<p>All the problems are happening in the Block. I've tried the
following methods of testing.</p>
<p>The below works fine and will spit out on the page correctly
(with the .xsl's style).</p>
<p><br>
<br>
<br>
<br></p>
<p>The following does not work. The PHP doesn't seem to output.</p>
<p><br>
<br>
<br>
<br>
<!--#START-CODE<?PHP echo '<server name="delta"
online="False" />';<br/> ?>#END-CODE--></p>
<p>The following also does not work. The PHP doesn't seem to
output.</p>
<p><system-xml><br>
<br>
<!--#START-CODE<?PHP echo '<server name="delta"
online="False" />';<br/> ?>#END-CODE--><br>
</system-xml></p>
<p>What I'm ultimately trying to do is have the Cascade page pull
XML data from a Block that uses PHP to populate XML data that is
fetched from the server's APC cache.</p>
<p>1) Cascade page hits Block<br>
2) Block uses PHP to fetch data from a URL.<br>
3) Data is cached in APC.<br>
4) Data is used on page load to send XML data back to the Cascade
page to style with the Format (.xsl).</p></div>Christag:help-archives.hannonhill.com,2010-02-09:Comment/54992832011-02-22T04:41:50Z2011-02-22T04:41:50ZHow do I use PHP inside a XML block?<div><p>Heh, guess the discussion board doesn't like XML tags -- or
maybe I should've wrapped them with some kind of [code] BBCode that
I wasn't aware of. Anyhow, here's the post in its full glory:<br>
<a href=
"http://pastebin.com/7KTKT5JH">http://pastebin.com/7KTKT5JH</a></p></div>Christag:help-archives.hannonhill.com,2010-02-09:Comment/54992832011-03-17T21:19:04Z2011-03-17T21:19:04ZHow do I use PHP inside a XML block?<div><p>Hi Chris,</p>
<p>I'm pretty sure you can't execute php within Cascade. In order
to accomplish what you are trying to do, my thoughts would be along
these lines.</p>
<ol>
<li>Create a feed block in Cascade to fetch the data from the
URL.<br></li>
<li>(If necessary, write an intermediary php script to process the
data and create an xml feed. Then point the feed block to
that.)<br></li>
<li>Use that feed block in the page region, and use the format to
style the xml data.</li>
</ol>
<p>Hope that helps.</p>
<p>Timothy</p></div>Timothy Gilman