Cody Connor

svg Images won't load

2 posts in this topic

I am currently working on a website in process wire.  I created an image field and added svg as a valid file extension and could upload a png image and a jpg image but when I try to upload a svg image it is stuck loading at 100%.  I figured out that the image field does not take the extension svg even if I add it as an extension. and I was wondering if their is any way to upload a svg image to an image field in processwire?

I am working with processwire version 3.0.61

loadingimage.PNG

Share this post


Link to post
Share on other sites

Welcome @Cody Connor,

SVG upload into an image field should work fine, I did it several times. Could it may be your SVG, that you try to upload, that is causing a problem? Could you try this SVG out for example?

SVG_logo.svg

Also you could take at look at your developer tools console while uploading if it throws any script error.

Regards, Andreas

1 person likes this

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.

  • Similar Content

    • By Peter Knight
      I have a page that's throwing an error because some of the pages in the for each loop don't have an image
      The docs say it's wise to check that an image has content and only then try to output something.
      I thought the following would work with the if($image) below.
       
      $products = $page->children(); foreach ($products as $prod){ $image = $prod->images->first(); echo" <div > <div class='prod-ov-wrapper'>"; if($image) echo " <a href='$prod->url'> <img src='{$image->height(160)->url}' class='prod-preview'> </a>"; echo" <div class='prod-ov-text'> <strong>Part No:</strong>{$prod->title} <br/> {$prod->prod_summary} <a href='$prod->url' class='uk-icon-button' uk-icon='icon: chevron-right'></a> </div> </div> </div> ";} What am I overlooking here? Thanks
    • By FrancisChung
      Hi PW Community,
      I have a problem where a page is loading up fine on my local dev machine + 1 of the test sites, but not on another test site.

      They have identical PW (2.8.35?) and codebase installed.
      The 2 sites are hosted on the same hosting provider, as well as our other sites.
      1) Error Logs. There is nothing particularly strange logged on the PW Error log for all the sites. I am getting a "You must assign a template to the page before setting custom field values (title__data) [pageClass=Page, template=] (WireLog)" error, but I'm getting this error on working pages as well.
       However, there are some errors in our Hosting Provider's log. The error seems to point at some sort of permissioning issue regarding reading the image files?
      1.a) File / Dir permissions of Images  - I've checked file permissions on the normal and problematic sites. They are all identical
      2) .htaccess  -  I've tried running the .htaccess file from the working site on the problematic site - No Luck
      3)  codebase - I've done 3 comparisons. They are identical on all sites.
      4) wire directory - See above
      5) Behaviour - So the problematic site loads up most of its page as expected without problems. It's just a couple that it has issues with.
       
      Problematic URL Example  : http://kinder-reime.com/kindergedichte/kategorien/gedichte-fuer-kindergarten-und-schule/
      Working URL : http://finger-spiele.com/kindergedichte/kategorien/gedichte-fuer-kindergarten-und-schule/
      I've also attached the KIS Error Logs.
      Has anyone come across  behaviour like this before and what would be the way forward to fix this?
      KIS.Error.Logs
    • By cosmicsafari
      Hi all,
      I am working on a module which creates templates, fields & pages upon install.
      I have ran into an issue where I have a numerous fields which I would like to override their labels depending on the template they are used in.
      Is it possible to do this dynamically via API at the point where I am creating the field group and template using the API.
      The following is the code which I am using at the moment.
      foreach($templatesArray as $name => $cTemplate) { if(array_key_exists('fieldGroup',$cTemplate)) { $fg = new Fieldgroup(); $fg->name = $name . '-fg'; foreach ($cTemplate['fieldGroup'] as $field) { //possibly at this point? $fg->add($this->fields->get($field)); } $fg->save(); } $t = new Template(); $t->name = $name; $t->fieldgroup = $fg; $t->noChildren = 1; $t->setIcon($cTemplate['icon']); $t->save(); } Is this even possible?
    • By cgohio
      We had an outside vendor help develop our website.  The vendor has closed their business.  I'm trying to modify 1 of the images near the bottom of our website but can't figure out how.  We're new to processwire.  I see how I can modify the individual pages but can't seem to figure out where to go to change this image n www.gchbs.com near the bottom  I attached the image that I need to change.  Thanks in advance for any of your help!

    • By MilenKo
      Hello all.
      I am trying to find a way to have a query with all pages that were published on a specific date (today for example). I read a few posts where people had a specific date field and were limitting the results by that, however is there a way to filter results without a specific date field? As far as I am able to publish the timestamp using $page->created logically I should be able to filter by the result of it? What is the best way to accomplish a filter for a day, week, month etc.?