Jump to content
nikola

Extending image field

Recommended Posts

I would like to know if it is possible and easy to extend FieldtypeImageExtra to have a Page field (instead of a common text field). This way, each image would have one or more pages associated with it. It would be like tags but the client can select a Page with the ACM Select component.

I guess it's easier to do this with an 'image' template but I loose the sorting manually by looking at the imagee (well, my client does). What do you think?

Was a solution found for this? I require pages to be assoicated with images also.

Share this post


Link to post
Share on other sites

I've managed to modified the original module to include a InputfieldPageListSelect.

Probably not good for large amounts of images due to the ajax calls. However for my purposes, a hero slider to link items, it works fine.

In template:

<a href="<?php echo $pages->get($img->link)->url?>">

post-1852-0-61210200-1389147938_thumb.jp

FieldtypeImageExtra-PageListSelect.zip

  • Like 3

Share this post


Link to post
Share on other sites

Hi,

I've a multilingual site with a galery. I'm new to PW, I can't find any solution to translate image field description.

Could someone help me?

I can change input type from Text to TextLanguage field type, here I'm missing ImageLanguage field type.

Share this post


Link to post
Share on other sites

I tried to use the plugin to extend the image field with 2 new text-input-fields. Everything seems to work fine except the data didn't get saved. Are there any additions to do to use the plugin with 2.4?

Share this post


Link to post
Share on other sites

Check your schema in FieldTypeImageExtra.module?

eg:

               public function getDatabaseSchema(Field $field) {
		$schema = parent::getDatabaseSchema($field);
		unset($schema['description']); 
		$schema['data'] = 'varchar(255) NOT NULL';
		$schema['title'] = "varchar(1024) NOT NULL";
		$schema['description'] = "text NOT NULL";
		$schema['link'] = 'int(11) NOT NULL';
		$schema['keys']['title'] = 'FULLTEXT KEY title (title)';
		$schema['keys']['description'] = 'FULLTEXT KEY description (description)';
		return $schema;
	       }
  • Like 1

Share this post


Link to post
Share on other sites

Oh, it was my fault, didn't know I had to change the schema.

Another question for this. I use Markdown Extra and the ACE-Editor for the textareas, is it possible to use this on the description field? It would be nice if you could configure the description field as any other textarea field.

Share this post


Link to post
Share on other sites

Thank you for the snippets, I used them to build a little Module to handle multi-language Image Descriptions and further image informations.

Have a look at the module FieldtypeImageExtra.

  • Like 1

Share this post


Link to post
Share on other sites

The field wasn't really designed for that particular use, so there currently aren't instructions on how to do that, but it's certainly possible (and probably not too difficult). But there isn't any easy answer to this question short of modifying the existing Fieldtype/Inputfield or creating a new one that extends it. I imagine that we'll have this built in eventually.

Any news on this? Would love to see it implemented. 

Share this post


Link to post
Share on other sites

Any news on this? Would love to see it implemented. 

To quote Ryan's latest blog post: https://processwire.com/blog/posts/more-images-upgrades/ - note the bit about "custom meta data fields"

 But we'd definitely like to explore some more things like custom crop features, more custom meta data fields and image editing tools when we get into ProcessWire 3.1.
  • Like 1

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...