Does Xojo allow us to make changes to .html files from within the IDE?

Hello: I may be overlooking how to do this, but I am wanting to edit .html files that I added to my Xojo project (someone else built these files for a different web app).

I dragged the .html files into my Xojo IDE, however I ‘m unable to figure out how to view what the page looks like in the IDE or even view and edit the html text itself. Am I doing something incorrectly?

I’m having to open the html files in a separate text editor and make the changes there. I was hoping to do this from within the Xojo IDE. I don’t want to have to redo these html files in Xojo unless there’s a way for me to copy/paste the html into a Xojo WebPage. It would save me a good bit of time if I could just leverage the IDE.

@Keith_Keller
You could use the WebHTMLViewer to view the .html
https://documentation.xojo.com/api/user_interface/web/webhtmlviewer.html

For editing, the html files are just like any text file, you will have to use Xojo text controls and string functions for editing

Xojo does not work that way natively. It creates HTML/Javascript from the controls that you place on a WebPage or WebContainer. There are ways to use HTML but that is not the intended purpose of Xojo.

I have a question about your request.

Do you want to take an HTML file and modify it before displaying it?

Or do you want to display the HTML and make changes directly to it?

Let’s say I have a file named: products.html that I dragged into the Navigator in Xojo. When I double click on that index.html icon in the Navigator, I’d like for the text of that file to be displayed in the Code Editor section of the IDE. That way, I can scroll through the html text, make modifications and then save it. I mean .html files are just text files, which is why I thought I’d be able to see and edit the text within them using the IDE.

From there, I can then right-click on the products.html icon and select “Open File” from the context menu and have the browser render the page so that I can see how things look.

You cannot edit text files with the Xojo IDE code editor. When you drag a file into the navigator, it is available to your app when code is running similar to a constant.

3 Likes

Bummer, but Thanks!

See Brian Franco’s recommendation. You want to program an XOJO application so that the goal user can modify an HTML file and see the changes.

As Brandon Warlick correctly points out, XOJO is not a tool for modifying HTML. You can create a web application with XOJO, but it doesn’t work for adding HTML and displaying the content as it should appear in a browser.

There are applications on the market for modifying HTML and displaying it exactly as it would appear in a browser.

1 Like

Minor correction. I don’t want it to render the html page as it would appear in the browser. I just want to edit the html text in the code editor, which it currently does not support.

Currently, you can right click on the html file in the Navigator and choose “Open File” from the context menu and Xojo will open that page in your web browser where it gets rendered. That part works just fine.

I already have a separate web development system which does both, however I’m hoping to perhaps use Xojo a bit more for my projects.

Thanks for your feedback. I’ll make do.

then just create a constant global in a module, and save the html inside
you will be able to edit it in the xojo constant editor as text (but no colored syntax…)

I do this a lot with html in my projects. But editing in the constant dialog is a bummer. It’s fine for short strings but for full html files I usually end up copying and pasting to BBEdit then copying and pasting back.

Another option is to keep your files as .html, then include them in a CopyFiles build step. Then you can edit them in whatever editor you’d like and your project will always have the latest version when you debug or build.

1 Like

It would be nice if the IDE supported editing files (as raw text, at least). We could avoid the need to remove the file from the project and re-import it (especially considering other bugs, which impact the ability to reliably set the position in the navigator).
It’s great you made a feature request.

You can download the GraffitiSuite sample (D/W/M) and run the GS Editor in Debug Mode locally (https://graffitisuite.com/features). This editor lets you drag-drop in an HTML file, edit it, then Copy-paste the HTML back into an HTML file without paying a dime/cent/pent.

1 Like

already a few feature requests. some are quite old !
https://tracker.xojo.com/xojoinc/xojo/-/issues/15860
https://tracker.xojo.com/xojoinc/xojo/-/issues/71525
https://tracker.xojo.com/xojoinc/xojo/-/issues/72696
https://tracker.xojo.com/xojoinc/xojo/-/issues/81303

1 Like