Search

Hi,

I'm using a script to generate images and would appreciate if anyone could suggest the best approach to calling it in Symphony. I'm coming from CMSs with PHP templates, where I could generate a cached version and just have src="cached.png" in the output.

The script takes a textarea's content to generate the image, and the issue is how to check if the cache exists, otherwise call the script. Would I need a custom field to allow me to process the data before the XML is generated?

I'd appreciate any suggestions from more experienced Symphony users.

Fish

I have a script that generates images based on text input.

foobar => foobar.jpg

I used the mechanics from JIT to create an extension where I integrated the image generating script.

In frontend the path to images is

src="{/data/params/root}/image_label/<list_of_parameters>"

and in .htaccess the following rule:

RewriteRule ^image_label/((red|blue).+)$ extensions/xs_labels/lib/image_label.php?param=$1 [L,NC]

In image_label.php I'm processing the input string.

I wanted to avoid appending the data to the src in any way because it tends to be around 200 chars. or more.

I've written a text formatter that passes the contents of the textarea through the image generating script and returns the cached image's path.

Very possibly not the intended purpose of text formatters, but it's done the trick.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details