Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is how I fixed this.</p> <ol> <li><p>Add the <a href="http://api.drupal.org/api/function/custom_url_rewrite_inbound/6" rel="nofollow noreferrer">custom_url_rewrite_inbound</a> function to check for incoming request ending with .xml. If it finds a request ending with .xml it strips that off, so that the correct data can be located by the rest of the drupal machinery. It also sets 'subsite_xml_request' to true so that the appropriate theme template can be used later. </p> <pre><code>function custom_url_rewrite_inbound (&amp;$result, $path, $path_language) { if(preg_match('/\.xml$/', $path)) { $search = preg_replace('/^(.*)\.xml$/', "$1", $path); if ($src = drupal_lookup_path('source', $search, $path_language)) { $_REQUEST['xml_request'] = true; $result = $src; } } </code></pre></li> <li><p>Modify the <a href="http://api.drupal.org/api/function/phptemplate_preprocess_page/6" rel="nofollow noreferrer">phptemplate_preprocess_page</a> function in your template.php to add additional '-xml' templates.</p> <pre><code>function phptemplate_preprocess_page(&amp;$vars) { if ($_REQUEST['xml_request']) { if (module_exists('path')) { $path = str_replace('/edit','',$_GET['q']); $alias = drupal_get_path_alias($path); if ($alias != $_GET['q']) { $template_filename = 'page'; foreach (explode('/', $alias) as $path_part) { $template_filename = $template_filename . '-' . $path_part; $vars['template_files'][] = $template_filename . '-xml'; } $vars['template_files'][] = 'page-xml'; } } } } </code></pre></li> <li><p>Create the required page-xml.tpl.php</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload