Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Arron.R on
I have a tool that publishes several hundred HTML pages daily. Although the directory structure is always the same, there are hundreds of pages and images that change.
I have been asked to put the daily updates on an existing Drupal server. However, the Drupal users have to log in and the published HTML and images should only be available to authenticated users.
Is there a way to create a directory of static html/images/js/css within Drupal that still require Drupal's authentication?
Comments
You'll need to build these
You'll need to build these HTML and images as pages in Drupal. So create a content type for these pages, then use https://www.drupal.org/project/content_access to prevent anonymous access to the content type.
I'm guessing this is for Drupal 7?
There are several thousand
There are several thousand HTML pages and images; several hundred of them change each day. It would be a full time job for a whole team. A very boring full time job. That's definitely not going to happen.
P.S. Yes, Drupal 7.
Either way, you will still
Either way, you will still need to get the static content into drupal first. The question is how without the tedious workload?
You can try importing the HTML into drupal with one of these modules:
https://www.drupal.org/project/html_import
https://www.drupal.org/project/import_html
Solved
Found an old module that should do the job perfectly: https://www.drupal.org/project/contentprotector
Can your HTML publishing
Can your HTML publishing platform emit XML or JSON? You could set up a Feeds importer to automate ingestion of the daily new content.
============================
Resonetrics: Better Tools for Building Brands
http://resonetrics.com
http://technologyformarketers.com
http://kittenassociates.org
http://www.linkedin.com/in/sammooreatresonetrics
The publishing system only
The publishing system only turns out HTML. The pages are massively interlinked, it relies on some fairly hefty JavaScript and there are also quite a lot of PDFs that it turns out.
I did look at Feeds but it was going to take several months of development and could have broken if there were any code changes on the publishing system.
The Content Protector module suits the job well. I know that it's a deeply unDrupal module but it means my effort can move to other problems. Long term the HTML will be getting its own web server anyway.