-
Posts
212 -
Joined
-
Last visited
Posts posted by Manaus
-
-
Thanks Wanze, still I noticed that if I use the Global File instead of the {extends} instruction, no block is being passed. Anyone tested this happening?...
-
Hello, in the settings page I'd like to know what "Global Template File - Filename of a template file that is used as main template behind the API variable" is for. I tried to make up a layout.tpl and use the file name as field setting, but looks like {block} contents are not passed to the file.
Thanks!
-
When I create a new page in the admin environment, the name field gets from somewhere a value like 2017-08-03-312631thursdayamerica-new_york, which is cool, but I'd like to enter the page title first. This default function seems somehow deactivated.
Since it is a fairly old website (2.7.x), I can't recall if I set that up, or it's some sort of plugin/function.
Thank for any suggestion
-
Hello, I'd like to know how to set the layout block logic for the ProcessWire side (the default one) of the templates. That is, twig uses {% block content %}, Jade uses block content, PW... ?
Also, is there documentation of the module for using PW as the main language? I checked the forums but found none...
Thank you very much
-
Hi @Gazley, just discovered, if the field is not autojoined, it is possible to use:
{{ page.get("body") }}
and it works as well. Doh!
-
1
-
-
Yes it did!
-
1
-
-
@Gazley you're the man
Thanks
-
1
-
-
Thanks @Gazley,
problem is that the view can output page.title which is native, but not page.body, unless it's out of a structure. I mean, if I set a variable 'thepage' as a container of one page
$view->set('thepage', $pages->get('/')) // I get all the fields: {{ thepage.body }} works $view->set('children', $pages->get('/')->children) // body of child is unknown
This valid also with getArray()...
-
Hi guys,
I have a .twig template I'd like to use as a children container.{% for item in page.children %} {{ item.body }} {% endfor %}
Problem is that Method Page::body does not exists or is not callable in this context. I think I should pass it explicitly. Anyone has a chunk of code on how to pass subpages to templates from a controller page?
Thanks!
-
Ok finally I got it, I added this line to the initEngine function within TemplateEngineTwig.module:
$this->twig->addExtension(new Twig_Extension_Debug());
And now there it is!
Thanks!!
-
1
-
-
Hi guys,
sorry I don't catch, I added this code to the _init filewire()->addHook("TemplateEngineTwig::___initTwig", function($event) { $twig = new Twig_Environment($loader, array( 'debug' => true, )); $twig->addExtension(new Twig_Extension_Debug()); });
By 'adding the extension' do you mean adding this code to a page?
Thanks -
Oh ok pal, no problem, thanks for your time!
-
I added
wire()->addHook("TemplateEngineTwig::___initTwig", function($event) { $twig = new Twig_Environment($loader, array( 'debug' => true, )); $twig->addExtension(new Twig_Extension_Debug()); });
to a _init.php file I prepend to pages, but alas, dump is still unknown....
Yes $config->debug is set to true in the config file...
-
I tweaked the function like this:
protected function ___initTwig(Twig_Environment $twig) { $loader = new Twig_Loader_Filesystem($this->getTemplatesPath()); // unless 'loader' unknown error $this->twig = new Twig_Environment($loader, array( 'debug' => true, )); }
But I get a unknown "dump" function.
I see there is also a initEngine function having'debug' => $this->wire('config')->debug,
So if debug is set to true, it should work...
Thanks
-
Hi @Gazley,
yes -- or I think so --: I have added these lines on top of the calling php page:
$twig = new Twig_Environment($loader, array( 'debug' => true, )); $twig->addExtension(new Twig_Extension_Debug());
But still {{ dump(var) }} is not recognized...
-
Hello, how do I enable the {{ dump(var) }} function in this module? Also if I do a var_dump from the calling page, the output is not displayed.
Thank you very much
-
Thanks guys,
I spotted also that some native objects are passed with native values only, e.g.{{ user.summerVacationHotelAddress }}
will not work.
-
Ok I got it, I gotta put values within the $view object.
It would be fun to have all values passed automatically yet. Too prone to chaos? -
Thanks jmartsch,
I'm using Template Engine Fatory, with 2.7.
I think the problem resides in passing values to the twig templates. If I do$login = $pages->get('/login/');
And then in the twig template:
<p>{{ login.url }}</p>
I don't see any value. How do I pass values?
Thanks!
-
Hello,
I'm trying out a template engine conversion of a website. In a foo.twig page I'm calling a isValidUser function, which I required in a foo.php template page. But the engine returns the function in unknown. How do I include functions in a twig template?
Thanks!
-
Is there a way to translate the prompt to action generated by this code?
Thanks!
-
Basically you have to create download pages under /downloads/, which is created by the plugin, for each file serving. You create them via the admin, or via API. Each /downloads/download/ page allows a file field and creates a unique hash, that you put, when invoking the file download, after the /downloads/hash/ url segment. Like for example /downloads/hash/18297192837oiu etc.
Each download page allows for 5 file download, but you can customize the number. You can also customize the expiring time in the plugin settings.
Be sure to tweak the plugin code as I mentioned in the post above, at least for me it solved a recurring bug.
-
1
-
-
Hello,
since include is sort of copy'n'pasting code in the calling file, I might have variables value overwriting.
Is it possible to have variables valid for the included file alone? Something like $this->title etc?
Thanks!
-
Hello,
I've seen a new kind of syntax, using curly brackets as {page.field}, available in the new branch of Processwire. But I can't really find the page reference/blog post about it. Any suggestion on where to find it?
Thanks!
Module: Smarty for the TemplateEngineFactory
in Modules/Plugins
Posted
@wanze Global file should make {extends} useless if I understood right. That's because in child templates {extends} works also if no Global File is specified in the admin pane. I hope I clarified the issue...