Jump to content

Mats

Members
  • Posts

    353
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Mats

  1. That sounds like an interesting module! I look forward to testing it.

    I don't mind the images being duplicated as that is how ProcessWire handles images.
    I think Media Lister with the proposed expansion of functionality would fill a need that seems to exist within the ProcessWire community (if you can live with duplicate images).

    I want to take the opportunity to say thanks for all the phenomenal modules you share with the rest of us @Robin S!

    • Like 3
  2. This is such a great module, thank you @Robin S

    Would it be possible to extend this module so it could be used for adding existing images to an image field?

    1. A button in the image field ("Add media") opens the Media lister module in a modal.
    2. You select an image from the list, on "save/add to page" the image is copied to the image field.

     

    • Like 2
  3. I have a single image field on the user template displaying an profile image in the page header. Strange thing is that on some request the field behaves as expected but on some requests it behaves like outputformaing is false (like an array). I cant seem to find any code that would turn off the outputformating so i'm a bit baffled with what's going on (most likely something i'm doing wrong).

    I'm using @teppo's wireframe, latest PW dev on the site. 

    Update: I commented out this: 

    $createdBy = $users->get("id={$fil->fil->created_users_id}");

    and the user image rendered as expected. 

    My guess is that i get a new user without the image and that causes the error.
    But how can i get one or more users without replacing the current one? 

    I changed the image field settings to maximum allowed files to 1 and formatted value to automatic. Now the previous page renders as expected but other pages containing the image field gets the following error: 

    Spoiler

    User Error

    Exception: Method Pageimages::size does not exist or is not callable in this context (in /home/mysite.com/wire/core/Wire.php line 563)

    #0 /home/mysite.com/wire/core/WireArray.php(2457): ProcessWire\Wire->___callUnknown('size', Array)
    #1 /home/mysite.com/wire/core/Wire.php(419): ProcessWire\WireArray->___callUnknown('size', Array)
    #2 /home/mysite.com/wire/core/WireHooks.php(968): ProcessWire\Wire->_callMethod('___callUnknown', Array)
    #3 /home/mysite.com/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pageimages), 'callUnknown', Array)
    #4 /home/mysite.com/wire/core/Wire.php(487): ProcessWire\Wire->__call('callUnknown', Array)
    #5 /home/mysite.com/site/templates/partials/navdesktop.php(24): ProcessWire\Wire->__call('size', Array)
    #6 /home/mysite.com/site/templates/layouts/default.php(41): include('/home/mysite/...')
    #7 /home/mysite.com/wire/core/TemplateFile.php(328): require('/home/mysite/...')
    #8 /home/mysite.com/site/modules/Wireframe/lib/View.php(84): ProcessWire\TemplateFile->___render()
    #9 /home/mysite.com/wire/core/Wire.php(413): Wireframe\View->___render()
    #10 /home/mysite.com/wire/core/WireHooks.php(968): ProcessWire\Wire->_callMethod('___render', Array)
    #11 /home/mysite.com/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Object(Wireframe\View), 'render', Array)
    #12 /home/mysite.com/site/modules/Wireframe/Wireframe.module.php(843): ProcessWire\Wire->__call('render', Array)
    #13 /home/mysite.com/wire/core/Wire.php(416): ProcessWire\Wireframe->___render(Array)
    #14 /home/mysite.com/wire/core/WireHooks.php(968): ProcessWire\Wire->_callMethod('___render', Array)
    #15 /home/mysite.com/wire/core/Wire.php(484): ProcessWire\WireHooks->runHooks(Obj … #33 {main}

    Update: Setting the user outputformating to true right before rendering the user image fixed it. I guess i have outputformating set to false somewhere but i'm unable to find it.

  4. @BitPoet I tested your solution and i'm probably missing something but it's not working. 

    I tried this after searching the API docs:

    Quote

     

    <?php namespace ProcessWire;

    if($page->editable()){
        $page->template->altFilename = "wireframe";
    }

    ?>

     

    And it seems to work.

    Sets the file but doesn't change it once it's set. 

  5. 36 minutes ago, Jan Romero said:

    Hm, does this still work for you? I just installed it and the download link appears, but it doesn’t seem to accept clicks:

    image.png.4acb685209862fa91094518b884c8f78.png

    Tested it in Default, Reno and UIKit themes, in Firefox and Edge. Maybe something else I’ve done to this install is messing with it, though 😅

    It's still working in an old install of mine somewhere. (I might have updated the code on the install and forgot to push it to the repository)

  6. Hi @teppo!

    I' trying to check what view file the user is on but the getView method returns null. 

    I'm using it like this in the controller (tried both in the render and init method):   

    if($this->wire('page')->name == "kopa-bil"){
            $this->view->setView('buy');
        }

    And

    $page->getView()

    in the view-file which returns null.

  7. Hello @teppo

    I'm having trouble when trying to use pagination on a view where the page array is coming from a controller with a limit ($this->wire('pages')->find('template=mytemplate,limit=20')).  When on a page number (page2 for example) the page array is null.  I've checked the allow pagenumbers setting on the template. 

    The pagination is working now, not sure what made it kick in, but it's working. ?

×
×
  • Create New...