Home » HTML » HTML_Template_IT » Bug #2683
Can not parse templates containing no placeholders/blocks
Details
| Request #2683 | Can not parse templates containing no placeholders/blocks |
|---|---|
| Submitted | 2004-11-04 00:04 UTC |
| From | somazx at shaw dot ca |
| Assigned | pajoye |
| Status | Bogus |
| Package | HTML_Template_IT |
| PHP Version | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2004-11-04 00:04 UTC] somazx at shaw dot ca
Description:
------------
Its common to want a graphic designer to modify templates as necessary for their purposes. Usually I will make the php code parse for a number of placeholder values likely to be needed by the graphic designer. On occasion the designer may not use any of these placeholders, or change their mind later in time to resume using some. Therefore I want the flexibility of parsing files which may/may not have empty placholders/blocks.
If you parse a template which contains no blocks/placeholders at all - then get/show methods will return null unless you turn on the flag to preserve empty blocks when you load the template. I'd reason this is because Template_IT treats the template (__global) as a block and strips it.
Its entirely possible though that you want empty blocks to be stripped - but preserve the contents of the __global block/template file and ::touchBlock doesn't work with __global.
Expected result:
----------------
return the contents of the template
[2004-11-04 00:21 UTC] somazx at shaw dot ca
Looking in IT.php source I notices __global__ being used and tried:
touchBlock('__global__')
and it worked. This approach allows for the functionality described above.
Using touchBlock('__global') returned this error:
Cannot find this block"__global'
[2004-11-05 12:53 UTC] pierre at dotgeek dot org
'__global__' is the default toplevel block.
--Pierre