I want to import static html reports generated for source code by code analysis tools like doxygen, understand. Is there any module that can import the html reports generated by these tools directly into drupal? I tried import html without any success. Any tried and tested procedure to achieve this feature ?


You can do it with the built-in text filter named "PHP Code". To get access to this, you need to first enable the core PHP Filter module (in core, but disabled by default). Then navigate to Home » Administration » Configuration » Content authoring » Text formats and allow the Administrator to use the filter named "PHP code".

Now the Administrator can create nodes that use the PHP include statement to embed static HTML pages in Drupal nodes. For example, to import a static HTML page located in the Drupal root named static.html, create a Basic page node with this contents:

<?php include $_SERVER['DOCUMENT_ROOT'] . '/static.html'; ?>

and set its text format to "PHP Filter".

Note that the "PHP code" text filter allows arbitary PHP to be embedded into nodes, so make sure that only highly trusted users have access to this filter.

  • Thanks for the answer. Can I import if there are many such file with links to each other? – Shan Oct 6 '13 at 10:52
  • I am not sure if I understand the last question, but I think the answer is "Yes". The only thing that happens with PHP include is that whatever is inside the file that is named will be included verbatim in the node. If there are links to other static HTML files in the file, then those links will be included along with everything else in the file. – Free Radical Oct 6 '13 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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