Jump to content

Recommended Posts

Posted (edited)

Hi blad - take a look on the Input tab of your images field and check the "Display thumbnails in page editor" option :)

Of course it doesn't float them like you have, but you can use the grid mode toggle for that - button at the top right of the field in the page editor.

PS Not meaning to suggest your enhancements aren't nice by the way :)

Edited by adrian
  • Like 6
Posted

Blad,

Nice effort. However, just wondering, how is this different from the grid view already available in ProcessWire image fields? Secondly, I am not sure this is a 'suitable' tutorial because you are editing/hacking a core file which is never good practice. It will get overwritten with upgrades. :-)

Edit:

OK, so Adrian beat me. 

@Adrian scores are now tied at 1 - 1

  • Like 2
Posted

Sorry you can delete this topic.

For me it's useful because I want my client doesn´t have to click to see all pictures and write descriptions.

  • Like 1
Posted

Sorry you can delete this topic.

For me it's useful because I want my client doesn´t have to click to see all pictures and write descriptions.

Absolutely not - I like what you have done - you just might want to consider changing the layout via a hook instead of modifying the core.

  • Like 4
Posted

Absolutely not - I like what you have done - you just might want to consider changing the layout via a hook instead of modifying the core.

Frankly, I have not thought and I just did. Create a hook module is the best way.

  • Like 1
Posted

Yeah I like it, frankly I'd like to see some more options beyond list and grid to boot. Like either a drag bar or option to set an arbitrary width on the thumbnail. I'd take a look if you made a module :) 

Posted

What hook can i use for create a simple module? I tried :

$this->addHookAfter('InputfieldImage::render', $this, 'xxx');

did´t work...

The hooks of inputfieldimage are:

/wire/modules/Inputfield/InputfieldImage/InputfieldImage.module

#27:public function ___render() {
#39:protected function ___fileAdded(Pagefile $pagefile) {
#65:protected function ___renderItem($pagefile, $id, $n) {
#91:public function ___getConfigInputfields() {

Thanks.

Posted

This works:

$this->addHookAfter('InputfieldImage::render', $this, 'addTest');

public function addTest(HookEvent $event) {
    $event->return .= 'test';
}

No need to go with InputfieldFile because your changes are only relevant to image fields.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...