[support] Alter node (title) field?

toon severijns toon.severijns at gmail.com
Tue Oct 2 12:13:17 UTC 2012


Hello,

Thanks for the advice!
I am stuck though on how to keep the formatting from Display Suite and only
alter the field value. The node in hook_view_node is a structured array
with the element '#markup' containing e.g. "<h4>Title</h4>". I'd need to
just alter the value and not worry about the formatting. Any ideas?

Best,


Toon

On Tue, Oct 2, 2012 at 4:40 AM, Eric Chen <eric.chenchao at gmail.com> wrote:

> Have you tried hook_node_load()?
>
> Cheers, Eric
>
> On Tue, Oct 2, 2012 at 11:42 AM, Ms. Nancy Wichmann
> <nan_wich at bellsouth.net> wrote:
> > How about hook_node_view_alter()? I've never tried it, but I'd really
> think
> > hook_node_view() would be the right place. There are also some field and
> > entity hooks that fire before that.
> >
> >  Nancy
> > Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L.
> King,
> > Jr.
> >
> > ________________________________
> > From: toon severijns
> > This must be a simple thing to do but i can't seem to get my head around
> it:
> >
> > I have got a content type 'publication'
> > A publication can have two possible physical formats: "normal",
> "electronic"
> > When a publication has physical format "electronic" i'd like to alter my
> > title field in al my view modes (i use display suite) like this "Some
> Title
> > (electronic)"
> >
> > I've been trying theme_preprocess_node function but to no avail.
> > I've also tried hook_node_view, but there i have my title field already
> as
> > markup in an array so i can't just alter the title itsself.
> >
> >
> > --
> > [ Drupal support list | http://lists.drupal.org/ ]
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20121002/3d95d9b9/attachment.html 


More information about the support mailing list