Hook available while adding data to structure field

In my frontend I show deep links into the panel for registered users to add data to structure fields of existing pages like this:


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?

Probably because of the entry that gets displayed. It will still display the entered value until the page is saved.

@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 :expressionless:

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. :slight_smile:

This is the single best tip and made my week. I implemented it already and it will save me a ton of time. Thanx again – I :heart: you all.