Minghui Yu
Minghui Yu

Reputation: 1363

Which node hook API shall I use? (Drupal 7)

I am working on a Drupal 6 to 7 site migration project. Many pages contain a custom token in [node-NID] format. The function of this custom token is to retrieve a node (identified by NID) body text.

After migration to Drupal 7, the custom function cannot work and I have no plan to write it because I find Advanced Entity Tokens can do a much better job.

So I want to keep [node-NID] in database, but whenever a node is loaded, I want to parse the loaded text to see if it contains an expression in [node-NID] format. If it does, then replace it with [aet:node:NID:body], which is custom token format that Advanced Entity Tokens offer. I will leave it to Advanced Entity Tokens to do the remaining work (replace token value)

Which node API hook shall I use?

Upvotes: 0

Views: 65

Answers (1)

Minghui Yu
Minghui Yu

Reputation: 1363

I found a better solution: use Custom Filter module

Upvotes: 0

Related Questions