-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Short description of the issue
ProcessWire v3.0 introduced a new type of module: File Compiler modules that extend the FileCompilerModule class. It also included a new module FileCompilerTags.
This issue is about the fact that File Compiler modules do not work when template files include the ProcessWire namespace.
To illustrate with FileCompilerTags...
basic-page.php without namespace:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo $page->title; ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" />
</head>
<body>
<h1>{title}</h1>
<?php if($page->editable()) echo "<p><a href='$page->editURL'>Edit</a></p>"; ?>
</body>
</html>
basic-page.php with namespace:
<?php namespace ProcessWire; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo $page->title; ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" />
</head>
<body>
<h1>{title}</h1>
<?php if($page->editable()) echo "<p><a href='$page->editURL'>Edit</a></p>"; ?>
</body>
</html>
The introductory blog post, the comments in FileCompilerModule.php
, and the comments in FileCompilerTags.module
do not mention that it is necessary for the ProcessWire namespace to be absent. And IMO it shouldn't be necessary - a person might include the ProcessWire namespace to get code completion and documentation in their IDE and this shouldn't impact on whether they can use File Compiler modules.
Setup/Environment
- ProcessWire version: 3.0.131