Rendering PHP Files with Radio UserLand

A Workbench visitor asks: How can I use Radio to render .php files instead of .html files when upstreaming?

The file extension is determined by the #renderedFileExtension directive. By default, files are rendered with the .html extension.

To set the extension to .php for an entire folder and its subfolders, edit the #prefs.txt file in that folder and add this line:

#renderedFileExtension "php"

Here's an example: the xmas.txt file and the xmas.php page it produces.

To set the extension only for a specific file, add the same line at the top of the file along with any other directives. Leave a blank line after the directives and before the content of the page, but don't put blank lines between each directive.

Comments

It has been a long time since I rendered a php page with Radio (I just upstream them directly with no alteration). But If IIRC, you better not use '#' for comment (I think that the setting to parse directive only at the top of the page is broken with Radio, not sure though). Also, your url migth get hotted by Radio and its might not what you want.

Also, I don't remember what I did for my php file not go thru the #template file or how I altered this file so the code was not altered.

Hi
and thanks Simon
but I fear I might not have made myself clear. I have been using your workspace.viewPostIndex.ftsc but since I have rendered my website in php - I have a load of broken links - it does not produce php links.
I wondered if there was a way to change the index script so that it would render the links as php?

I already tried the prefs file and now i have tried the individual file method but with no joy.

Setting the directive in #prefs.txt works -- I just tested it myself. There's nothing in my script that affects the file extension of a page that displays a post index.

I'll try again - maybe I made some typo. I obviously messed up. Thanks for the time to check that. Appreciated.

the file extension of a page that displays a post index
I can get the page rendered in php but not the links generated on that page.
I want it to work for the actual links generated. What am I doing wrong?

http://www.ghettogeek.co.uk/links/index/listindex1.php

My mistake -- I didn't realize that the file extension of each weblog entry on the post index is hard-coded as ".html". Here's an updated version of workspace.viewPostIndex. Save it to disk, open it within Radio, then replace the existing workspace.viewPostIndex. Let me know if it works and I'll release it.

It's working great. Same link as before.
http://www.ghettogeek.co.uk/links/index/listindex1.php
Thanks so much. That ties up a lot of loose ends for me (or loose links).

Add a Comment

All comments are moderated before publication. These HTML tags are permitted: <p>, <b>, <i>, <a>, and <blockquote>. This site is protected by reCAPTCHA (for which the Google Privacy Policy and Terms of Service apply).