Jump to content

Manaus

Members
  • Posts

    209
  • Joined

  • Last visited

Everything posted by Manaus

  1. 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
  2. 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
  3. RT @doodlewhale: That wholesome feeling when you think you are contributing but you really have no idea what you are doing. https://t.co/80…

  4. RT @processwire: ProcessWire nominated for Best Open Source CMS, Best Free CMS, Best SB CMS at @cmscritic awards! Please vote at https://t.…

  5. RT @newsonaut: The unsung hero of CMS’s. https://t.co/qA07mXgw3H

  6. RT @OmnibusType: Say Hi! to Chivo #freefont by H. Gatti https://t.co/2MXSyFbZtE Thanks! @NOTISMAPP, @UXDesignNews and @DesignWorkflow https…

  7. RT @baekdal: Just saying... https://t.co/k8L7Sbhr8C

  8. RT @idiot: https://t.co/1akqloKN6k

  9. Hi @Gazley, just discovered, if the field is not autojoined, it is possible to use: {{ page.get("body") }} and it works as well. Doh!
  10. 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()...
  11. 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!
  12. 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!!
  13. Hi guys, sorry I don't catch, I added this code to the _init file wire()->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
  14. Oh ok pal, no problem, thanks for your time!
  15. 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...
  16. 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
  17. 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...
  18. 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
  19. Thanks guys, I spotted also that some native objects are passed with native values only, e.g. {{ user.summerVacationHotelAddress }} will not work.
  20. 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?
  21. 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!
  22. 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!
  23. RT @49SD: Oh my god whoever made thing thank you! https://t.co/XalO15FOPn

×
×
  • Create New...