Hello everybody,
as described in another question (solved), I have a plugin that creates hash values from a given string. (I'm copying some lines now, so that this thread provides the whole needed context. My question introduction below is printed in bold.)
Example (within a wiki page):
* String: TEST
* Hash code: {{hash>TEST}}
My plugin converts the 'hash' pattern into an MD2 hash string with the given parameter (here: TEST).
So when viewing the page, the result looks like:
- String: TEST
- Hash code: a96df14f8b5ccb567eede45bdddf189f
Now I want to make use of this hash creation mechanism within another plugin's SpecialPattern. In effect I want to have the created hash value within an exported ODT file.
The other plugin is the fields plugin, and I want to use something like the following:
{{fields>pagecode={{hash>TEST}}}}
in a way that the fields plugin sees and processes:
{{fields>pagecode=a96df14f8b5ccb567eede45bdddf189f}}
Thus, I need a nested traversal. First, my plugin, then the fields plugin.
I tried the following, but fields still won't recognize the result and thus does not start its work. Output is simply: }}
- I assured that in syntax.php, getSort() of my plugin returns a lower value than fields' getSort() (a value of 0 vs. 319).
- I added an array containing 'substition' to getAllowedTypes() within fields' syntax.php.
- My plugin returns 'substition' in getType().
- As one try, I changed the type of the field plugin to 'container', so that it's not 'substition', which, according to the documentation, is not meant for nesting.
- I created a short version of my command
{{testhash}}
to prevent my regular expression from taking in the wrong closing braces. So I'm trying {{fields>pagecode={{testhash}}}}
, too.
So aside from the fact that I actually rewrite another plugin's code, I can't even get it to do what I need.
As a last resort, I could add my hash generation code to the fields plugin and adapt it's behavior accordingly. But a nested solution with my separate plugin would certainly be better (update-wise), so I'm going for that one, first.
Any suggestions would really be appreciated!