I want to alter a body's node value, but without saving it:

the altering depend of a array of values, witch it could change sometime, so i have to update every node at each change if i save it. Anymore, the backward before re- altering it could be very complicate.

For now i change the render value in a preprocess theme hook.

But if the body is very long, the altering could be hevy.

So i'm thinking about something like that :

  1. Before rendering, check the body's node cache.
  2. if it's empty, generate it with the altered value.
  3. when updating values responsable of altering the body's, i reset the node cache.

Is there a common way to do this using the drupal's system cache or have i to make my own for this specific task?

  • I am going to rephrase your quesion, I am a bit confused, hope I got you right: 1) You want to render the body field in a custom way, using an array of values, where do they come from? 2) On which level do you want to utilize cache? E.g. for anonymous page views? Cheers – Stefanos Petrakis Apr 25 '16 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.