Jump to content

Recommended Posts

Short version

Can we make the Page fieldtype as the tagging engine for images?

Long version / real example

I started using image tags for the first time after reading making efficient use of fields in PW. There's a part titled 

Use multi-file fields to replace several single-file fields where Ryan mentions tagging.

As I was building a site for an interior designer, I needed an almost identical setup and to tag images with a gallery with "basement", "living room", "garden" and "kitchen" tags.

At one stage, my client wanted "basement" changed to "basement and garden" and I had to manually edit about 15 images. No big deal really but it doesn't seem very scalable.

Having used the Page fieldtype for tagging blog posts and news and experienced how easy it is to make global tag names changes etc, I wondered if the Page fieldtype could be put on the roadmap as the tagging engine for images or at least as an option.

  • Like 1
Link to post
Share on other sites

A trick on such a use case could be using pages for single images...so a pagefield for tagging is  no problem...but it is a other imagemangment like:

https://processwire.com/talk/topic/3219-images-manager-beta/

or simpler with a little module for creating albums/single imagepages from uploaded files...

https://processwire.com/talk/topic/8698-creating-page-for-every-image-uploaded/page-2#entry84891

(a page could be everything - the image = page has some cons and some pros like counting, cleaner urls...and so on)

but the handling is a little bit difficult - it's always more or less work - for eg. to change the selection to the image-root page on the WYSIWYG PW-Image modal:

https://processwire.com/talk/topic/7439-processpageeditimageselect-hook-and-change-default-page/#entry71673

Otherwise you could fast change the tags with the api i think? May a little admin form for editors would do the job for chaning regular image tags?

regards mr-fan

Link to post
Share on other sites

Hey Mr-fan

That occurred to me (pages as single images) and would have a few benefits in this project. I might even go down that route as the portfolio grows.

Was thinking too that I could use Lister pro then as a kind of Images manager. Kind like what Soma is doing with his setup.

Otherwise, I was just putting it out there that it's be a nice idea? Probably not easy or quick to refactor in terms of the core but would be a nice addition.

  • Like 1
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.

  • Similar Content

    • By spercy16
      These issues should be fairly easy for any intermediate to advanced ProcessWire developer to answer. I'm new to PHP and relatively new to ProcessWire and just need a bit of help. What I'm trying to do is bring in a couple of cards from my Projects page to display on my home page. I finally got the code right to bring in the cards but right now they're using my original images instead of my resized "variations". So firstly, I would like to know how to reference the variations of my images instead of using the original. Secondly, I need to grab only four of the cards from the Project page and not import in all ten. It should be just two small changes to my code to do these things (I would imagine). Here is the code I currently have for that section:
      <?php // https://processwire.com/api/arrays/ // check if the array of images has items if (count($pages->get("/projects/")->images)) : // get array of images from the field $images = $pages->get("/projects/")->images; $count = 0; // iterate over each one foreach ($images as $image) : $count++; $sectionText = $pages->get("/projects/")->get("paragraph_$count"); $img = $image; $buttonCode = $pages->get("/projects/")->get("url_$count"); ?> <span id="card<?php echo $count?>" class="card"> <img class="cardThumb" src="<?php echo $img->url; ?>" alt="<?php echo $image->description; ?> Thumbnail" /> <div class="cardBody"> <div class="cardText"> <h2><?php echo $img->description; ?></h2> <?php echo $sectionText; ?> </div> <div class="primaryBtn"> <a href="https://www.paypal.com/donate?hosted_button_id= <?php echo $buttonCode; ?> &source=url"> <button> <i class="fas fa-donate"></i> Donate </button> </a> </div> </div> </span> <?php endforeach; endif; ?> Thanks in advance for any help!
    • By skeltern
      WebP image support is great and works fine. But once created I've issues to get rid of all API generated WebP variations.
      The backend image field variations "Delete" works and I can remove all variations JPEG plus WebP. Image list is clean but all WebP API variations are still stored in file system (for instance files/12345/84.900x675.webp etc). I can only use ImageSizer with temp 'force' option to request fresh WebP variations or have to delete WebP files from folders. No other way so far. Tested with 2 sites and latest master PW 3.0.165.
      Is there somewhere a "magic button" or config/setup thing to solve my sticky WebP issue?
    • By psy
      I've searched, and maybe missed, the solution. I have a 'normal' images field and uploading images with a file size greater than 10Kb is fine. Any image size smaller results in the never-ending spinner and no upload.
      No min/max width/height set on image uploads in admin, ie just the defaults.
      Any ideas on how to fix?
      Using:
      PW: 3.0.175
      PHP: 7.3
      Marking it as "Resolved" rather than "Solved" as it auto-magically fixed itself. No idea whether PW, PHP, or just an internet hiccough... All good now 🤞
    • By rjgamer
      Hi,
      is there a hook after the current (active) page got created? Or which method got called in the Page class after the Constructor of the current page got initialized?
      Thanks.
       
    • By rjgamer
      Hi guys,
      the field "redirect_last" of type DateTime got not updated. The update on the field "redirect_counter" works and got saved.
      Does anybody know what I did wrong in my code?
      if ($input->urlSegment(1) === 'redirect') { $page->of(false); $page->redirect_last = time(); $page->redirect_counter += 1; if ($page->save('redirect_counter')) { $session->redirect($page->website_url, 302); } } Thanks.
×
×
  • Create New...