Resource icon

SVG Template by Xon 2.1.5

No permission to download

Xon

Well-known member
Xon submitted a new resource:

SVG Template by Xon - SVG as Templates

Depending on configuration, this add-on requires webserver URL rewrite support!

Allows SVG (Scalable Vector Graphics) images to be stored as templates. This creates a new svg.php file in the XF root directory.

To generate a link to an SVG template;
Code:
{{ getSvgUrl('tempate.svg') }}
Under Board information, if "Use Full Friendly URLs" (useFriendlyUrls) is set the URL generated is:
Code:
/data/svg/<style_id>/<langauge_id>/<style_last_modified>/<templateName>.svg
...
Read more about this resource...
 

Xon

Well-known member
Xon updated SVG Template by Xon with a new update entry:

2.1.0 - Feature update

  • Extend XF2 router to provide /data/svg support for svg templates.
    • Still recommend webserver rewrite rules if possible
    • If using apache you must adjust the default htaccess rewrite rules provided by XenForo;
      • Add the following;
        Code:
        RewriteRule ^data/svg/([^/]+)/([^/]+)/([^/]+)/([^\.]+).svg$ svg.php?svg=$4&s=$1&l=$2&d=$3 [B,NC,L,QSA]
        before
        Code:
        RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
      ...
Read the rest of this update entry...
 

Xon

Well-known member
You need to ensure the entire contents of the zip are uploaded, and you need to ensure the svg.php file is being executed. Webserver configuration support is outside the scope of this add-on
 

Crazy-Achmet

Well-known member
I've tried to get special node icons from svg templates.

Code:
{{ getSvgUrl('pl_nodeicons_{$node.node_id|raw}.svg') }}
Sadly this doesn't work since the node id isn't translated into the real id. Is there any work around?
 

Crazy-Achmet

Well-known member
That did work out, thank you!

Sadly the image isn't showing up. There is no /data/svg folder, so the image (
/data/svg/16/2/1566837122/pl_nodeicons_65.svg) doesn't exist.

I've uploaded all the files and added the rewrite rules to NGINX.
 

Xon

Well-known member
That did work out, thank you!

Sadly the image isn't showing up. There is no /data/svg folder, so the image (
/data/svg/16/2/1566837122/pl_nodeicons_65.svg) doesn't exist.

I've uploaded all the files and added the rewrite rules to NGINX.
You need to add this sort of rewrite rule;
Code:
location ^~ /data/svg/ {
  access_log off;
  rewrite ^/data/svg/([^/]+)/([^/]+)/([^/]+)/([^\.]+).svg$ /svg.php?svg=$4&s=$1&l=$2&d=$3$args last;
  return 403;
}
Depend on nginx config, this likely needs to be at the top of the server { } block before any other locations.
 
Top