Just a collection of resources for Perch CMS I have either made or modded.
Place these in addons/fieldtypes
Outputs a image as a base64 sting (e.g data:image/.png;base64,iVBORw0KGgoAAAANSUh...) will also respect normal image type attributes (crop, width, desity etc).
example use in content templates:
<img src="<perch:content type="base64img" id="" label="" />" alt="" />
requires imagemagick
Outputs a blurred img as a base64 sting (e.g data:image/.png;base64,iVBORw0KGgoAAAANSUh...) will also respect normal image type attributes (crop, width, desity etc).
- Blur amount (1 = the lowest)
example use in content templates:
<img src="<perch:content type="base64blur" id="" label="" bluramount="1" />" alt="" />
outputs a HEX ref using the (amazing) iris colourpicker
example use in content templates:
<perch:content type="colour" id="" label="" />
Place these in addons/editors.
* This addon does not come with the redactor editer itself. You must have the redactor (1.6) editor installed/added in the addons/editors folder for this to work. *
Redactor editor but with a character count and limiter. This editor is a little bit of a hack. Rather then creating a custom tag, I am using the size tag to pass a class which contains the character limit to the textarea field in the editor.
example useage:
Lets say we want to add a 250 character limit to the textarea. To do this we would need to add size="charlimit-250"
. For a 300 limit size="charlimit-300"
and so on. We would also need to set the editor tag to editor="redactor-limiter"
.
Example usage in a template tag:
<perch:content type='textarea' id="" label="" html="true" editor="redactor-limiter" size="charlimit-250" />
Hidden region indicator
Word of warning. This was is build for a spesific need, therefore it is not very robust. By all mean use/mod this but if you upgrade it drop me a line :)
This tweak inserts a new column into the region table on the page edit page. It was build for a region that does not use multiple items. To use include the php script to your UI include file in 'perch/addons/plugins/ui/_config.inc' (example file included).
Example:
A example content templet is included in the 'content' folder. Basicaly you ould wrap your conent in a perch:if statement. If the script does not find the
the perch:if statement it will display the region as 'displayed'.