Hello and Questions from a Beginner

Hey Guys,

Brand new to Xojo, coming from a background of PHP/MySQL Development.

I wondered if I could ask a Noob quesitons about Xojo when it comes to web.

Firstly, Is it possible to style pages using traditional CSS/SCSS(SASS) methods? A lot of the tutorial videos I’ve watched all kinda use the default styling which looks a bit like a desktop app on a browser. I am essentially wondering if this would allow me to build a web application with a web like UI integrating with things like Bootstrap and jQuery elements as examples?

I have seen the ‘styles’ within the IDE but they seem rather limited.

My second quesiton is about URL’s, the examples I’ve seen all have .cgi prefixes I’m assuming that its possible to have “pretty” urls with Xojo? I guess it could be managed with a .htaccess file in Apache.

I am impressed with Xojo and will be delving more deeply into it, I love the idea of being able to create a Web App with the option of a Desktop Managment tool without ever having to leave the IDE, and already have a application in mind to experiment with!

Any help appreciated!

Cheers,

Which is exactly what Xojo created and markets it as.

That being said, there are a lot of styling “hacks” to make it look more to your liking. Load a CSS file in the header (App.HTMLHeader) and/or use ExecuteJavaScript to modify the page/controls at runtime. You can also create your own controls with better styling options (see below).

Use the WebSDK to wrap these into your own custom controls. There are examples of using the jQuery calendar control and YUI Rich Text Editor in the WebSDK examples folder (/Extras/WebSDK/Examples)

You have two deployment options: CGI and Standalone. Each has its pros/cons: Standalone is it’s own webserver, so there’s no need for Apache or anything else. And performance is usually better than CGI. But Standalone can not currently do SSL, and serving static content is not it’s strong suit. CGI, as I’m sure you already know, requires a web server like Apache, which allows Apache to handle SSL and static file serving for you, freeing up your app do just do what you program it to do. With either deployment, you can hide the cgi and/or port number using various methods, like .htaccess on Apache or using nginx in front of a Standalone. If you need help with either of these, just ask.

Jay, could you tell me what’s needed in the .htaccess to hide the cgi, etc?

I am interested in changing www.domain.com/cgi-bin/myapp/myapp.cgi to just be www.domain.com
if possible

I am sure there is a best practice or way to hide all the .cgi stuff and just use a normal domain url, but I have not found out how to do it yet, so if anyone is willing to share, I would appreciate it.

Thanks

It won’t hide the full URL, but an index.html redirect will let you set up www.domain.com to automatically go to the CGI URL. The technique described here should work with any web server:

http://blog.xojo.com/2014/05/22/redirect-your-domain-to-a-xojo-cloud-web-app/

Here’s an example of an .htaccess file that uses mod_rewrite to load a CGI, and the path to the cgi file is never actually displayed to the user.

AddHandler cgi-script .cgi Options +ExecCGI RewriteEngine On RewriteRule ^/?$ /MyApplication/myapplication.cgi [L]

That’s for a CGI that’s hosted at Media Temple, so you might need to tweak it a little to get it to work with your host.

If you want to see it in action, go to http://labs.xgravity.net/MyApplication/.

Paul, if I use the redirect will any url parameters be lost, or can I pass them along to interrogate them in my app?

Tim, I am looking more at your also.

Tim, I would like www.domain.com to actually go to www.domain.com/cgi-bin/myapp/myapp.cgi, so I am wondering if I can change the RewriteRule to accomplish that.

This may be a dumb question, but I will have many websites, so is it best to setup a virtual host for each or is there some way to have everything in subdirectories in the one cgi-bin directory and get it to point to the various real directories

You’d probably have to talk to your hosting provider to determine what’s best for you, based on the server configuration.

With Media Temple, you can host multiple domains / subdomains, with each pointing to their own root. So you can put htaccess files in each one. However, in my case, I’m using a single subdomain with multiple CGIs stored in individual folders.

ok, let me play for a while and get back to you guys.
Thanks