Jump to content
nabo

Image variation creation

Recommended Posts

Hello

I'm working on a project that use PW as backend CMS. PW serves formatted data of each page but the engine simply generates json from pagearray.
I would like to set one or more variations on images, so I think it would be useful if there were a field to set possible variations... even with overrides!

Share this post


Link to post
Share on other sites

You could use a Table (or multiplier) field to set this up. And when rendering your JSON output, generate the variations using the Table field data on the page. 

Share this post


Link to post
Share on other sites

Yes... but these settings make sense if they are at field/template level, not page.

Share this post


Link to post
Share on other sites

I'm not sure if field or template level is really what you're after and not rather "site wide" level. If you need settings, which apply to your whole site you can always create a single page, which holds all the setting for the your site. You could even make a custom api variable with it in e.g. `init.php`:

$this->wire('settings', $pages->get("parent=1, template=settings"));

If you don't need the settings to be editable via the admin interface you can also attach your own properties to $config.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By toni
      Hi,
      I'm facing a strang problem. In my template I'm setting different sizes for srcset:
      $view->set('images', $page->picture); <img srcset="{$img->size(780,0)->url} 780w, {$img->size(1024,0)->url} 1024w, {$img->size(1440,0)->url} 1440w" src="{$img->url}" class="col__image"> All fine. However, the moment I reorder images in backend the different generated image sizes are broken.
      Does somebody has an idea what could cause it? 
      Version: ProcessWire 3.0.123 
       
      Thanks!
      Toni
    • By Mithlesh
      Changing it to null
    • By Mithlesh
      Hi, I have one URL - writerrelocations.com/contact-now/

      I have one issue where my header Image is appearing again after the contact form, for your reference:



      I have checked my processwire template section where have not added any Image field besides Header Image, attaching the same for the reference:




      PLEASE help me to get rid of the image below contact form

      Waiting for the swift response!

      Thanks
       
    • By tonicastillo
      Hi. Can I ask why this happens?
      When I upload a jpg, the meta keywords and description of the file loses the accents and spanish symbols of the words.
      Original image on the left, and the image generated by PW on resize on the right.

      This happens on resize. The uploaded file is ok.
      How can I control which meta keep in the photo?
      Thanks a lot (and sorry for my English)...
×
×
  • Create New...