Jump to content


Photo
- - - - -

Vectors

SVG

  • Please log in to reply
7 replies to this topic

#1 capgras

capgras

    Member

  • Members
  • PipPip
  • 27 posts
  • Country: Country Flag

Posted 27 November 2013 - 09:44 AM

Hi, I'm aware that .svg is not supported by wordpress by default, however there are some workarounds, which make using .svg in wordpress possible, these plugins or modifications allow me to upload .svg image files and use them wherever a bitmap image can be used.

The problem is, DMS seems to have a list of supported image extensions somewhere inside also, example: i can upload a .svg image into a gallery and using third party image displaying plugins incorporate .svg into DMS, this is a hassle as most of these third party 'boxes' dont work nicely with DMS as DMS components do, but DMS 'media box' still tells me .svg is not supported as an image file, although, as i said, my wordpress now accepts .svg and i can even use shortcodes to implement .svg into third party components ,not in a DMS 'text box' though.

 

I guess my question is, is there a way to change the default extension image layout for DMS aswell, as my wordpress is now accepting .svg, my DMS still won't. (i can use .svg in those default worpress themes).


Edited by capgras, 27 November 2013 - 09:46 AM.


#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 16923 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 27 November 2013 - 02:33 PM

HI,

 

To be totally honest, I am not sure. I will need to speak to one of our developers regarding this. I have bookmarked your topic and as soon as I have more information, I will reply here.

 

You could try this:

 

Using FTP or command line if you know how, navigate to the following directory

 

wp-content/themes/dms/editor and open the editor.actions.php file.

 

Navigate to line 302 and you will find the following line of code:

 

$allowed_file_types = array( 'image/jpg','image/jpeg','image/gif','image/png', 'image/x-icon');

 

Replace it with this:

 

$allowed_file_types = array( 'image/jpg','image/jpeg','image/gif','image/png', 'image/svg' 'image/x-icon');

 

and see if that does the trick, reply here if it does and I will do a pull request.



#3 capgras

capgras

    Member

  • Members
  • PipPip
  • 27 posts
  • Country: Country Flag

Posted 27 November 2013 - 03:36 PM

i get this:

 

Parse error: syntax error, unexpected ''image/x-icon'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in C:\wamp\www\oblik2\wp-content\themes\dms\editor\editor.actions.php on line 313

 

the line is obviousely different, its 313 not 302, maybe i should update dms? maybe the list appears somewhere else in the DMS code so it needs to match this one.. just a thought.



#4 capgras

capgras

    Member

  • Members
  • PipPip
  • 27 posts
  • Country: Country Flag

Posted 27 November 2013 - 03:40 PM

$allowed_file_types = array( 'image/jpg','image/jpeg','image/gif','image/png', 'image/svg', 'image/x-icon');a comma was left out in the code you provided, i no longer get a syntax error but the .svg still wont upload



#5 capgras

capgras

    Member

  • Members
  • PipPip
  • 27 posts
  • Country: Country Flag

Posted 27 November 2013 - 03:44 PM

thanks for the help, i hope DMS gets .svg support in the future, it would be awesome...



#6 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 28 November 2013 - 07:15 AM

Try switching 'image/svg' to 'image/svg+xml'



#7 capgras

capgras

    Member

  • Members
  • PipPip
  • 27 posts
  • Country: Country Flag

Posted 28 November 2013 - 09:26 AM

no, it still acts the same.

 

http://s8.postimg.or...h0sywet/aq1.jpg



#8 Danny

Danny

    Is Awesome!

  • Moderators
  • 16923 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 28 November 2013 - 11:35 AM

OK, I will need to speak to one of our developers and see if we can add support.







Also tagged with one or more of these keywords: SVG