One of the fields is a link field and I want to paste there “dirty” links with parameters, anchors etc. which I want to clean before these links gets saved as structured field contents. Is there a hook I can use to clean these links?
There is currently no hook for structure items, only when saving the whole page, which will have access to the structure field as well however. Here’s an example of a hook that modifies the structure field, in this case to sort the items.
There is no hook that is triggered before the page is saved, but why would you need that? Should be no problem to first save the page and then change the links?
@lukasbestle is right. These are links I copied from an RSS reader (Reeder). Often these RSS links are contaminated by Google Analytics and other analytic services’ stuff. I don’t want to have them on my website and they would also temper the authors analytics, since when my visitor click on such a link they are not from an RSS reader anymore.
So as an interims solution I am back to a Textexpander solution
As we wrote: You can use a hook, but it will apply when saving the page, not when saving the structure item. It is only a minor detail, but your site will display the cleaned link.