Jump to content

Manaus

Members
  • Posts

    212
  • Joined

  • Last visited

Everything posted by Manaus

  1. @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...
  2. 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?...
  3. 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!
  4. 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
  5. 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
  6. 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…

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

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

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

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

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

  12. Hi @Gazley, just discovered, if the field is not autojoined, it is possible to use: {{ page.get("body") }} and it works as well. Doh!
  13. 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()...
  14. 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!
  15. 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!!
  16. 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
  17. Oh ok pal, no problem, thanks for your time!
  18. 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...
  19. 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
  20. 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...
  21. 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
  22. Thanks guys, I spotted also that some native objects are passed with native values only, e.g. {{ user.summerVacationHotelAddress }} will not work.
  23. 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?
×
×
  • Create New...