OK, I can see that. I don't actually need links in both directions. One way is fine.
Only problem still is removing a link.
[quote]Currently as you see you can only delete links whose parent is the asset that fires the trigger, I guess it should be called "Remove child links" and we should make another one "Remove parent links". The candidate links are the child assets as far as I remember, so setting that to current asset is not going to work, but setting to a GET var which is the other end of the relation should work.
Will try to find some time to do some testing - we have got this working, but had to add some of that trigger functionality to do it![/quote]
This does sound as if it is possible to access an asset and then have a trigger have remove a specific link. It does not matter to me if it is the child or the parent that is accessed. Both will work. But I have been unsuccessful so I'm suspecting it is a bug in my particular case.
I have filed this as bug #3794:
[codebox]I am trying to use a trigger to remove a link to a page when this page is accessed.
- Create a page 'Test page' (#23121)
- Create a folder 'test folder' (#23125)
- Go to Linking screen of 'test page' and create a Type_2 link to 'test folder'
- Result is 'test page' shows underneath 'test folder' in the asset map
- Create trigger 'Test remove link'
- Events: Asset Accessed
- Conditions: tree location 'parent folder of test pages'
- Actions: Remove links
- Ignore permissions
- As linked to the Broadcasting Asset, which also resides under the Root Node 'parent folder of test pages'
- With Link Type 'ANY_TYPE' and Link Value Any Link Value
- Uncheck 'Only where Candidate Assets are Directly Linked to the Root Node'
- Linked Asset Type '-- All asset types --'
- Parameter 'Candidate Assets' = GET variable 'candidate-asset'
When I call the page (#23121) that is linked under neath the folder (#23125) :
http://test-page/?candidate-asset=23125
the trigger fires but nothing gets unlinked.
When I call the folder (#23125) that has the linked page page (#23121) under it :
http://test-page/?candidate-asset=23125
the trigger fires but nothing gets unlinked.
I have tried many combinations but I can not have this trigger remove any link.
The logs show only that the trigger was executed but nothing else.
[/codebox]