aboutsummaryrefslogtreecommitdiff
path: root/doc/forum/Howto_add_tag_from_plugin_code.mdwn
blob: a17faf727fc9a71991383aed3e68b858d43defa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
Hi, I want to add tags to some pages automatically (generating album images 
and want to tag all generated pages). I managed to do so in following way:

    IkiWiki::Plugin::tag::preprocess_tag(
        page => $viewer,
        destpage => $params{destpage},
        map { ($_ => 1) } @tags,
    );

This works, however if some tag does not exist, it is not created. I tracked it so far that I found that the Render.pm's method gen_autofile() is not called , so it is most likely that I need to somehow trigger Render.pm's refresh()...but how can I do it?

BTW: The code is modified album plugin that is in [my git](https://github.com/llipavsky/ikiwiki)