Embedding a game on a Joomla Site

Get help using Construct 2

Post » Tue Feb 19, 2013 5:20 am

Using the Sourcerer plugin I have included the the body section of the Contruct index.html file in my article.

I then edited <script src="c2runtime.js"></script> to be <script src="http://mygameshost/c2runtime.js"></script>

The problem is that the JS file refers to the images and media via a relative address and I need it to point to an absolute, fixed address. I tried editing c2runtime.js file and it just breaks.

Any ideas?
B
4
G
2
Posts: 42
Reputation: 811

Post » Tue Feb 19, 2013 5:23 am

What I should have been clearer about is that the Joomla and Construct hosts are two separate hosts.
B
4
G
2
Posts: 42
Reputation: 811

Post » Tue Feb 19, 2013 10:51 am

Seeing as how your game and the Joomla page are hosted by different hosts, I'd refer you to the use of iframes.

It's good enough for cross-domain content, though should be avoided if the iframe is pointing to the same domain it's on.
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Wed Feb 20, 2013 7:57 am

OK so I got it to work 100%.. and this is how

When exporting to HTML I set the folders as follows:
games/sc/images
games/sc/media

I then uploaded the games folder to the root of my Joomla host. I also uploaded jquery-1.7.1.min.js, c2runtime.js and logo.png to the Joomla root.

I edited the c2runtime.js changing all occurrences of games/ to ../games/

The body section of index.html I pasted into the required Joomla article using the sourcer plugin.

So that I could add more games in future I renamed c2runtime.js to c2runtime-sc.js and updated its reference to such in the article body :-)
B
4
G
2
Posts: 42
Reputation: 811


Return to How do I....?

Who is online

Users browsing this forum: Renfd, supreme676 and 29 guests