Jump to content

Recommended Posts

Posted

I read somewhere that you could use $page->render('emails/base.php') to render a page using a specific template. However it doesn't seem to be working, it's still trying to use _main.php. Not sure what the expected behavior of this is or if i'm doing it wrong,

Posted

Either what @bernhard said or your path is wrong. The last is the main thing I'm struggling quite often with.

When I get my paths right it works as expected.

Even with things from repeater/repeater matrix items.

2035737175_2019-05-3020_57_56.png.0d8febb047330a201f87dc98cdb5fd25.png

  • Like 1
Posted

I think the path is correct. It should be relative to site/templates, right?

It does look like the config appends it was $config->appendTemplateFile = '_main.php';

Not sure how you get around this.

Posted

It should. My example above will therefore look in /site/templates/_view/FILE.php - this works in about 99% of all cases. Sometimes... I don't know why it doesn't. In those rare cases I have to write render("./_view/..."). and need to add this ./ before the path.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...