<<TableOfContents>>

= arnica =
arnica is based on the [[ParserMarket/Gallery2]] parser. It is an [[http://hg.moinmo.in/moin/1.7-extensions/|extension]] for MoinMoin 1.7 and 1.8.

The arnica extension gives you the opportunity to organize images and present them in your wiki. It supports some basic image processing operations by enabling an optional tool set. The action arnica_slides is used to play a slideshow of the selected images. 

== Installation ==
Download the [[http://moinmo.in/ReimarBauer/HelpOnArnica|arnica-1.7.1beta2.zip]] package file and upload it to your wiki. You can install it using the install dialog going to Attachments. Fur further informations on packages see HelpOnPackageInstaller. After installation and configuration (see next topic) the wiki needs to be restarted except for cgi deployment.

/!\ !CopyThemeFile of !PackageInstaller is currently just supported on standalone-like servers.

Separate htdocs theme files [[attachment:htdocs_arnica-1.7.1beta2.zip]]


=== 1.8 installation ===
Because 1.8 supports multiple plugin directories, you can also, instead of downloading the zip files, just check out the repository:
{{{
cd /some/where
hg clone http://hg.moinmo.in/moin/1.7-extensions
}}}

and add the appropriate configuration option:
{{{
plugin_dirs = ['/some/where/1.7-extensions/data/plugin']
}}}

You still need to use the htdocs as above, but you can just symlink from the repository checkout into your web server's directory.

== Configuration ==
The action and the parser are based on css. You have enter html_head into your wikiconfig. 
{{{
html_head = '''
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="%(url_prefix_static)s/arnica/css/text_x_arnica.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="%(url_prefix_static)s/arnica/css/arnica_slides.css">
''' % {"url_prefix_static": url_prefix_static}
}}}

== Parameter ==
||'''name'''||'''default'''||'''description'''||
||target_page||u`''`||page to read attachments from. empty pagename is current page||
||columns||4|| number of columns for thumbnails||
||file_regex||u'.'||regex for selecting images ||
||image_for_webnail||False||if set then the image is shown instead of the webnail ||
||show_text||True||default shows description ||
||show_date||True||default shows date from exif header if available ||
||show_tools||False||default does not show icon toolbar||
||sort_by_date||False|| if set, sorts images by the modification time||
||sort_by_name||True||default, sorts images by name ||
||sort_by_alias||False||if set, sorts images by the alias name, this needs also only_items enabled||
||reverse_sort||False|| if set, the file list is sorted in reverse order||
||only_items||False||if set, only images which are described in listitem are shown ||
||template_itemlist||False||if set, an item list is shown which could be copied into the wiki page ||
||album||False||if set, selects album mode, only thumbnail from first image is shown, related is album title and album_image||
||album_title||unicode||default is pagename of the images for the album.||
||album_image||u`''`||image to show on album. default is the first image ||
||renew||False ||if set then all selected thumbnails_* and webnails_* are removed and will be recreated||
||thumbnail_width||128px||default width of thumbnail ||
||webnail_width||640px||default width of webnail ||

== itemlist ==
{{{
  * [[image1.jpg|alias]]
  * [[image2.jpg|alias]]
}}}

== Usage ==
 * This parser can be called using the [[HelpOnProcessingInstructions|processing instruction]] `#format`. {{{
#format arnica
}}}
 * or as parser {{{{{
{{{
#!arnica
 * [[image1.jpg|alias1]]
 * [[image2.jpg|alias2]]
}}}
}}}}}
 * or by its wrapper macro. {{{
<<arnica>>
}}}


= Examples =
== one item to define an alias for an image ==
{{{{{
{{{
#!arnica
* [[100_1185.JPG| Bremen, SpaceCenter]]
}}}
}}}}}

 Result::
{{{#!wiki comment
#!arnica file_regex=100_11[8-9][0-9]
* [[100_1185.JPG| Bremen, SpaceCenter]]
}}}
{{attachment:result1.png}}

== only thumbnails, only_items text and date surpressed, tools shown ==
{{{{{
{{{
#!arnica show_text=0, show_date=0, show_tools=1, columns=2, only_items=1
 * [[100_1185.JPG| BremenSpaceCenter]]
 * [[100_1194.JPG| Bremen]]
}}}
}}}}}

 Result::
{{{#!wiki comment
#!arnica show_text=0, show_date=0, show_tools=1, columns=2, only_items=1,file_regex=100_11[8-9][0-9]
 * [[100_1185.JPG| BremenSpaceCenter]]
 * [[100_1194.JPG| Bremen]]
}}}
{{attachment:result2.png}}

== only_items by two columns, date supressed ==

{{{{{
{{{
#!arnica columns=2, only_items=1, show_date=0
 * [[100_1185.JPG| Bremen, SpaceCenter]]
 * [[100_1194.JPG| Bremen behind SpaceCenter]]
}}}
}}}}}

 Result::
{{{#!wiki comment
#!arnica columns=2, only_items=1, show_date=0, file_regex=100_11[8-9][0-9]
 * [[100_1185.JPG| Bremen, SpaceCenter]]
 * [[100_1194.JPG| Bremen behind SpaceCenter]]
}}}
{{attachment:result3.png}}

== file_regex used, date supressed, one column ==
{{{{{
{{{
#!arnica columns=1, file_regex=100_118[0-5], show_date=0
}}}
}}}}}

 Result::
{{{#!wiki comment
#!arnica columns=1, file_regex=100_118[0-5], show_date=0
}}}
{{attachment:result4.png}}

== macro arnica ==
{{{
||<<arnica(album=1)>>||<<arnica(album=1, album_image=100_1194.JPG, album_title=Bremen)>>||
}}}

 Result::
{{{#!wiki comment
||<<arnica(album=1, file_regex=100_11[8-9][0-9])>>||<<arnica(album=1, album_image=100_1194.JPG, album_title=Bremen,file_regex=100_11[8-9][0-9])>>||
}}}
{{attachment:result5.png}}

== renew means always new thumbnails and webnails of selection ==
{{{{{
{{{
#!arnica only_items=1, show_date=0, show_tools=0, renew=1
 * [[100_1189.JPG | Bremen]]]
}}}
}}}}}

 Result::
{{{#!wiki comment
#!arnica only_items=1, show_date=0, show_tools=0, renew=1, file_regex=100_11[8-9][0-9]
 * [[100_1189.JPG | Bremen]]
}}}
{{attachment:result6.png}}

== text and only_items and sort_by_alias ==
{{{{{
{{{
#!arnica show_text=1, show_date=0, columns=2, only_items=1, sort_by_alias=1
 * [[100_1185.JPG| Bremen, SpaceCenter]]
 * [[100_1194.JPG| Bremen]]
}}}
}}}}}

 Result::
{{{#!wiki comment
#!arnica show_text=1, show_date=0, columns=2, only_items=1, sort_by_alias=1, file_regex=100_11[8-9][0-9]
 * [[100_1185.JPG| Bremen, SpaceCenter]]
 * [[100_1194.JPG| Bremen]]
}}}
{{attachment:result7.png}}

== text and only_items and sort_by_date, reverse order ==
{{{{{
{{{
#!arnica show_text=1, show_date=1, columns=2, only_items=1, sort_by_date=1, reverse_sort=1
 * [[100_1185.JPG| Bremen, SpaceCenter]]
 * [[100_1194.JPG| Bremen]]
}}}
}}}}}

 Result::
{{{#!wiki comment
#!arnica show_text=1, show_date=1, columns=2, only_items=1, sort_by_date=1, reverse_sort=1, file_regex=100_11[8-9][0-9]
 * [[100_1185.JPG| Bremen, SpaceCenter]]
 * [[100_1194.JPG| Bremen]]
}}}
{{attachment:result8.png}}

== template itemlist ==
{{{{{
{{{
#!arnica template_itemlist=True
}}}
}}}}}

 Result::
{{{#!wiki comment
#!arnica template_itemlist=True, file_regex=100_11[8-9][0-9]
}}}
Copy the following listitems into the script. Replace alias with the label you want. Afterwards disable template_itemlist by setting it to False:
{{attachment:result9.png}}

== slide show ==
When you click on the slide show icon or an thumbnail the arnica_slides action is called.
{{attachment:result10.png}}

== refresh ==
Using the supplied refresh action you can easily remove the thumbnail and webnail cache files.
