0 Favourites

Embedding a game on a Joomla Site

  • 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?

  • What I should have been clearer about is that the Joomla and Construct hosts are two separate hosts.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

  • 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 :-)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread sticky
763 305,643
asikanddestroy's avatar
asikanddestroy
Unread hot topic
232 177,673
Tetriser's avatar
Tetriser
Unread hot topic
266 15,900
GameeApp's avatar
GameeApp