Martin Truckenbrodt wrote:if the MODs are supporting UMIL then you can use the config values <name of MOD>_version to get automatically compatibility with other MODs.
Thanks for the reply, but I'm not sure how I would apply this to the changes I've added to my MODX file? Specifically I'd like to do something like:
Code: Select all
<open src="foo.php" type="if-exists">
<!-- Edits etc. -->
</open>
So that the edits can be skipped if a particular file (that may not be installed) does not exist, rather than throwing up an error in AutoMOD like it does now. I suppose it's more of an AutoMOD feature since for the MODX file itself I can just add a comment telling the user to skip the step if they don't have the file, but AutoMOD doesn't seem to have the ability to do this.
I'd like to be able to do the same thing with
<edit>
commands, so that I can look for edits made by other mods to resolve incompatibilities, or to ensure my code appears at the correct position.
For example, if my mod, and someone else's mod both added code after the same
<find>
command, then depending upon the order in which our mods are installed incompatibilities could arise. But if I could detect the other mod then I could change my edit to a before-add instead, to ensure my code executes first.
The edit might look something like:
Code: Select all
<edit type="if-found">
<find><![CDATA[$foo = 'bar';]]></find>
<!-- An action, inline find, whatever -->
</edit>
Basically the edit would only continue if its
<find>
statements are matched, otherwise it's okay to just skip it.