2

I've been given a ZIP file with the JS, CSS, HTML, and assets for a stand-alone jQuery application. We would like to host this application through our Drupal 7 site hosted on Acquia Cloud. I am looking for best practices on where to store this application. I've included additional info below but can supplement if there's other relevant info. Can anyone suggest where I should store these files?

Due to some business-related decisions, we will always receive updates to this application in a ZIP file. It may or may not receive updates. If it does, we'd like our content admin team to be able to manage it through Drupal or FTP. It has not yet been decided if the application will be embedded in a page or accessed on it's own.

In our current site, we are not able to upload an entire directory and keep it in the same structure. Each file must be uploaded manually. We are fairly new to Drupal so I don't know if there is a module that would get us around this issue.

I am not allowed to make changes to the code or alter the directory structure (as that would require changes to the file references).

If there are no best practices for this, we can store it somewhere else and link out to it. I would prefer to avoid this but if that's the recommended best practice, we can do it.

2 Answers 2

1

My gut feeling would be to place it in a folder in the root of your website and access it through a subdomain. I'm not sure, without knowing more about the application, if there is an effective way to integrate it with Drupal. It seems like it should stand on its own, in it's own directory structure, as it is a separate entity. I stand to be corrected here, but i don't see a problem with hosting it concurrently with your Drupal installation. It won't be manageable through the CMS, but without building the functionality in Drupal itself, it wouldn't be anyway.

1
  • This is the only sensible answer really, it comes down to "it's your server, put the files where you want them to be hosted, just make sure you don't nuke part of Drupal's code when you do it". Oh, and be mindful when upgrading Drupal; if you have an automated process, adjust it if necessary
    – Clive
    Jan 23, 2017 at 18:10
1

If you have a library (js and css files) called MyOwnLibrary

You can create a folder called myownlibrary in sites/all/libraries and placed the js file myownlibrary.js in the folder, so the structure is like this:

YourSite/sites/all/libraries/myownlibrary/myownlibrary.js

And you can use the Libraries API module to use your library

The common denominator for all Drupal modules/profiles/themes that integrate with external libraries.

This module introduces a common repository for libraries in sites/all/libraries resp. sites//libraries for contributed modules.

You can check more info in the Libraries documentation page.

5
  • This is more of a stand-alone application. We're not really referencing the JS/CSS. The HTML bundled with it does. Are you recommending that we create a module that wraps this application? Jan 23, 2017 at 17:04
  • @Skoberlink Usually if you have some code to share between many modules you use a librarie, maybe is better if you take a look inside some modules that use libraries to see how this works. Take a look to this module: drupal.org/project/phantomjs_capture Jan 23, 2017 at 17:27
  • This code isn't being shared between even one module @Adrian, it's a standalone app the op happens to want to serve from the same location as the Drupal site. Nothing inside Drupal could help with this (unless there's eg an ftp widget in he admin interface that facilitiates the upload). Libraries are only appropriate for assets that the Drupal site itself will consume. A standalone app will stand alone, and not get involved with Drupal.
    – Clive
    Jan 23, 2017 at 18:07
  • @Clive sorry maybe I don't understand the question, should I delete my answer? Jan 23, 2017 at 18:11
  • Up to you :) I think maybe you've misunderstood the situation the op is in but I could be wrong too
    – Clive
    Jan 23, 2017 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.