Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to embed an in-line svg file with {exp:stash:embed} or {exp:stash:get file="yes"} fails #60

Closed
nyehughes opened this issue Sep 10, 2013 · 3 comments

Comments

@nyehughes
Copy link

Hi Mark,

I'd like to embed (or 'get', not sure which is better) as section of inline svg code into my template using Stash. However, the parser assumes it will have the html extension, and cannot read it.

I have currently worked round the by adding svg to the permitted file extensions for Stash embeds in your core code:

array('html', 'md', 'css', 'js', 'rss', 'xml', 'svg');

but then I get the following error message 'Parse error: syntax error, unexpected T_STRING' in ... libraries/Functions.php(680) : eval()'d code on line 534

So I have two questions:

  1. Is there any way to embed in-line svg without hacking your core?
  2. Is there a way to get the svg code read without triggering a php error?

UPDATE: I've solved the parse error message by running the module updates. So just question one remains. I guess I could just rename the svg file to html, but that feel's a bit uncomfortable.

UPDATE 2: I've now seen you can add svg as a permitted file type via the Stash config variables. So in other works all queries resolved!

Thanks in advance, Nye

@croxton
Copy link
Owner

croxton commented Sep 10, 2013

Awesome, glad you worked it out. I should probably make this a bit clearer in the wiki. Closing.

@croxton croxton closed this as completed Sep 10, 2013
@Joshuwar
Copy link

Hey, sorry to resurrect this, but I'm having difficulty working out how you can add .svg as a permitted filetype via Stash config variables. It would be helpful for me (and for other future users!) if you could post the line you added to your config, or a link to a fuller explanation elsewhere :D

@croxton
Copy link
Owner

croxton commented Mar 14, 2016

$config['stash_file_extensions'] = array('html', 'md', 'css', 'js', 'rss', 'xml');

See: https://github.com/croxton/Stash/wiki/Installing-%26-upgrading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants