Jump to content

Image field problem


WebMaster
 Share

Recommended Posts

Hello,

I need to add additional attributes to Image field. For my situation not enough description and tags attributes. For example, I need to enter additional options for positioning individual images thumbnails on images gallery. It's is way to extend Image field? Or I have use other way to solve this problem? I tried to use ImageExtra field, but this field is very simple and I cant use processwire features like images files sort.

Link to comment
Share on other sites

Hi @WebMaster

As far as I know, current only ImageExtra module adds support for additional fields for images. Native support for additional properties in image/files fields is on the roadmap for 2018. 

For now, the most flexible route for you is to create a page for every image, in that way you will get all PW features. There is module that can help with this approach

 https://github.com/mr-fan/AutoImagePages

14 minutes ago, WebMaster said:

I cant use processwire features like images files sort.

Do you mean that you can't sort and search by custom ImageExtra fields? 

  • Like 1
Link to comment
Share on other sites

14 hours ago, WebMaster said:

For example, I need to enter additional options for positioning individual images thumbnails on images gallery

Can you describe in more detail what this means? Why can't you use tags for this?

Sorting by filename is trivial "out of the box" with PW:

$imgs = $page->images;
foreach($imgs as $img) {
    $imageFileNames[] = $img->name;
}
sort($imageFileNames);
echo '<pre>';
print_r($imageFileNames);
echo '</pre>';

(assuming you need sorting in the frontend output).

If you would add tags and / or descriptions you could build an associative array instead.

  • Like 1
Link to comment
Share on other sites

Maybe you can use the the imagesExtra module, drop your sorting-module and install AOS (Admin On Steroids). WIth AOS you can add filter and searchboxes to images fields, what makes it very conveniant to find images with specific strings. So, I'm not sure if that search/filterfield includes all imagesExtra fields by default. But a quick question to @tpr will shed some light, I hope. :)

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...