MadeMyDay / PageTableExtended

Extends the Processwire PageTable field for rendering table row layouts.
15 stars 11 forks source link

Path to templates my version #16

Closed somatonic closed 8 years ago

somatonic commented 9 years ago

I had problems with custom template path setting throwing error, because of file not found, as PW tries to use the default template path when rendering page. I fixed it with using TemplateFile() correctly, as you can actually render the TemplateFile you setup instead of the page, and it will render the template file.

So how does the template know what $page is? That's why I also added a template var "page" so the $page variable works in the code of template file.

$parsedTemplate->set("page", $p);

Also set for convenience a "isAdmin" variable to the template as it's less verbose.

$parsedTemplate->set("page", $p);

In template code:

if(isset($isAdmin)) ..
vs
if(isset($options['pageTableExtended'])) ...

I created a pull request here https://github.com/MadeMyDay/PageTableExtended/pull/15

MadeMyDay commented 9 years ago

already merged ;-)