Jump to content

PW for dummies - Multiple images with better appearance


blad
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...