PageAvatar is an advanced plugin used to associate pages with any types of files and manage such links. This is a simple yet powerful solution we normally use to build picture galleries for the websites powered by Cotonti.
Authors: esclkm, Kort, Cotonti Team
Github: https://github.com/Alex300/cotonti-pageavatar
#1. Installation
The plugin is very easy to use. All you have to do is:
- Unpack upload and install Pageavatar plugin
- Add code snippets to page.add.tpl and page.edit.tpl (or category-specific templates)
- Add settings strings for each specific category (see below)
- Create folder(s) for file uploads as needed
Page.add.tpl:
Add plugin tags as follows:
<tr>
<td>{PAGEADD_FORM_AVATAR_TITLE}:</td>
<td>{PAGEADD_FORM_AVATAR}</td>
</tr>
Page.edit.tpl:
Add plugin tags as follows:
<tr>
<td>{PAGEEDIT_FORM_AVATAR_TITLE}:</td>
<td>
{PAGEEDIT_FORM_AVATAR}
<!-- IF {PAGEEDIT_FORM_AVATARFILE} -->
<p>{PHP.L.Uploaded}: {PAGEEDIT_FORM_AVATARFILE}<br /> {PHP.L.Delete}: {PAGEEDIT_FORM_AVATARDELETE}</p>
<!-- ENDIF -->
</td>
</tr>
The structure of a settings string is as follows:
category code | path to uploads folder | thumbnail mask(s) | mandatory? | extension(s) | thumb creation mode
Brief explanation:
- category code is... the category code (you can use 'all' to deal with all uploads)
- path is the path to the folder you want to store the files in (we recommend ./datas/smth/)
- thumbnail mask is best explained with an example: thumb_150-200 (add thumb_ prefix to the filename, height 150, width 200)
- if you want to specify mandatory upload add 1 here, otherwise 0 (optional)
- specify extensions you want to restrict uploads with (optional)
- this is the way you want thumb to be generated: crop is crop, height gives you height priority, width -- width priority, frame means the thumb will stay within the specified height and width
You can now get your image paths in the LIST_ROW regular block or elsewhere, i.e.:
- ./datas/{LIST_ROW_CAT}/{LIST_ROW_AVATAR} will give you ./datas/shop/page_234.jpg
- thumb_{LIST_ROW_AVATAR} will give you thumb_page_234.jpg
Should you have any questions or would like to report a bug, feel free to open a topic at the forums.
Version History
- 4.0-4.0.4 - several improvements and Compatibility with PHP 8.1
- 3.27 - fixed crop bug (overwrite all files)
- 3.26 - first public release, first 3rd party Siena plugin ever

Russian Manual for the Pageavatar Cotonti Plugin
Thanked: 9 times
Is there a special way for upgrading?
Thanked: 217 times
The plugin works around a single extrafield, so there are no special upgrade instructions except backing up database.
Thanked: 9 times
{PAGEADD_FORM_AVATAR_TITLE} is not giving any text output
Thanked: 217 times
Fixed for fresh installs. Otherwise input the extrafield title manually
Thanked: 76 times
new version http://littledev.ru/news/cotonti/cotontifolio/pageavatar4.html
Thanked: 7 times
"Fixed for fresh installs. Otherwise input the extrafield title manually" - нрифига не Fixed!
The new version works perfectly, thanks esclkm!
Thanked: 1 time
its not working with 0.9.19. when you try to upload on the page.edit, nothing happend. I mean it didnt upload image and didnt add data to page_avatar on the database.
Thanked: 1 time
https://github.com/esclkm/pageavatar is working. If you want thumb, you should use option like "all|datas/photos|thumb_150-200|0||crop"