Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Extensions / Files & Media / Pageavatar 3 for Siena

Lightweight and flexible solution for linking files to pages and lists

 

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 Genoa.

How Does It Work?

The plugin is very easy to use. All you have to do is:

  1. Unpack upload and install Pageavatar plugin
  2. Add code snippets to page.add.tpl and page.edit.tpl (or category-specific templates)
  3. Add settings strings for each specific category (see below)
  4. 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

  • 3.27 - fixed crop bug (overwrite all files)
  • 3.26 - first public release, first 3rd party Siena plugin ever cool

Russian Manual for the Pageavatar Cotonti Plugin


1. pieter  2011-04-06 10:59

Thanks: 0

Is there a special way for upgrading?

2. Kort  2011-04-07 04:54

Thanks: 0

The plugin works around a single extrafield, so there are no special upgrade instructions except backing up database.

3. pieter  2011-04-12 20:35

Thanks: 0

{PAGEADD_FORM_AVATAR_TITLE} is not giving any text output

4. Kort  2011-04-17 19:06

Thanks: 0

Fixed for fresh installs. Otherwise input the extrafield title manually

5. esclkm  2011-04-26 17:43
6. Uch  2012-04-22 15:23

Thanks: 0

"Fixed for fresh installs. Otherwise input the extrafield title manually" - нрифига не Fixed!

7. fade2k  2012-10-03 20:02

Thanks: 0

The new version works perfectly, thanks esclkm!

8. n0fx  2016-10-30 21:22

Thanks: 0

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.

9. n0fx  2016-10-31 00:45

Thanks: 0

https://github.com/esclkm/pageavatar is working. If you want thumb, you should use option like "all|datas/photos|thumb_150-200|0||crop"

Total: 9, on page: 9

Only registered users can post new comments