Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Posts posted by dragan

  1. 7 hours ago, franciccio-ITALIANO said:

    but... with Wamp I must update with filezilla, right? 

    Nothing against Filezilla, but I'd suggest you use WinSCP instead. But yes, you'll need some sort of FTP client.

    A good IDE can also watch out for you and automatically upload files to your server whenever a change is detected (new file being created or saved).

  2. 3 hours ago, ottogal said:

    The <li> elements have to be children of an <ul> element (alternatively of an <ol> element).

     

    ... and those have to be children of body, not html :-)

    7 hours ago, Lmwt said:

    due to delayed output

    How do you include this list in your main template? regular include() ? In that case, you don't output anything in that partial, just build a string with PHP that you then echo() in your main template. You should definitely look into some beginner tutorials and docs - templating in PW really isn't hard to grasp. For the above list, you could use PHP's heredoc syntax. btw, for your last two fields you would need slightly more, since these are probably file/image fields (like $page->images->first()->url or whatever you need)

    • Like 1
  3. Datetime of files are already saved automatically by the API, but without created/modified infos about the user.

    Maybe using a hook and set / modify page meta would work?

    I haven't looked into the brandnew PW dev branch and the new custom fields for files. This would be the most straightforward way - if you could easily protect those custom (sub-) fields in the admin (not viewable, not editable - same way you can use any regular field). But even then you would need a hook (maybe this one?)

  4. On 10/9/2019 at 11:22 PM, psy said:

    template=onecolumn|twocolumn

    @Atlasfreeman Do you actually have template files for those templates?

    How complex are those pages? Maybe you can just as well output the fields of those pages instead of using render().

    Some more infos and options:

    https://processwire.com/talk/topic/13958-help-understanding-render-and-rendervalue/

    https://processwire.com/talk/topic/12228-render-options-documentation/

     

    • Like 1
  5. 1 hour ago, adrian said:

    To change the user via the API, you don't actually need to check the "allow the created user to be changed on pages" option.

    When I ran the code I posted above without the "allow..." check, funnily Tracy had output the new user ID, but when I re-opened the page in admin, the old created-user was still there. Kinda weird...

    PW 3.0.138, advanced mode + debug mode on.

    Anyway, maybe just a caching issue.

  6. There is an option in template settings (Advanced tab -> Template toggles -> Allow the 'created user' to be changed on pages).

    After you activated this, you can use the API (inside a template or via Tracy Debugger console):

    $p = $pages->get(11201);
    d($p->created_users_id); // 41
    $p->created_users_id = 10040;
    $p->save();
    d($p->created_users_id); // 10040

    d() is dump command inside Tracy

    • Like 4
×
×
  • Create New...