Jump to content

Manaus

Members
  • Posts

    212
  • Joined

  • Last visited

Posts 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. 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()...

  4. 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!

  5. 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

  6. 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...

  7. 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

  8. 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.

    • Like 1
  9. 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!

×
×
  • Create New...