Allows you to define sets of settings in Web.config and reference them by name.
Also offers a method for restricting commands to predefined presets, for the truly paranoid.
The current version only works with the URL API.
<add name="Presets" />to the
A named preset can specify default settings (these can be overridden in the URL), or normal settings (which override corresponding URL settings) - or both.
<resizer> ... <presets onlyAllowPresets="false"> <preset name="thumb-defs" defaults="width=100;height=100" /> <preset name="thumb" settings="width=100;height=100" /> <preset name="thumb-width" defaults="height=100" settings="width=100" /><!-- The height can be overriden, but not the width --> </presets> ... </resizer>
When onlyAllowPresets="true", all other querystring pairs will be stripped from the URL.
Naturally, this will break the RemoteReader plugin if you're using the signed URLs.
onlyAllowPresets does not apply to the managed API, only to the URL API.
Use a default settings group, then override the width:
Referencing a normal preset
Referencing a preset with both default and normal settings, and overriding the default height
Referencing two presets (although they're kind of redundant in this example)
This plugin (Presets plugin) is part of the Essential edition
Where is the plugins section?
<plugins> section is located in Web.config, and is nested inside the
<resizer> element, which is nested inside
<configuration>. For examples, see this sample Web.config file.
Where can I find the dll?
We prefer that you install via NuGet, but you can also find the plugin DLL files in the /dlls/release folder of your download.
How do I typically install a plugin via Web.Config?
- In Visual Studio, right click on your project and choose "Add reference". Browse to the plugin DLL and click "OK".
- In the <plugins> section of Web.config, insert <add name="PluginName" />
- Look at the plugin documentation to see what configuration options (if any) are available.