custom field

Events happening in the community are now at Drupal community events on www.drupal.org.
jmaines's picture

Can I access field data with PHP code in a custom field using Display Suite Code?

Can I get a value in a node field in code? I want to use that code to make a decision on how to render an image or to determine which image will be displayed.

Using tokens doesn't work. I tried token_replace and token_scan, but they don't work. The $node variable is not available. $entity doesn't seem to contain node field data and I am not able to create a fully populated node.

I figured it out. I was making a syntax error while accessing $entity. I found it using Devel.

Thanks

Read more
jlmainguy's picture

How to get a custom group field with Views?

Hi,

I was looking for a way to retrieve a custom field from a group in a view?

For example, I have my Group content type in which I added a custom field (say the «Group Color» field).

Then, I wanted to build a view in which I could show the current node's group «Group Color» field. I was able to retrieve the current node's group ID, but not the custom field.

I built the view showing any type of node and used the OG Groups relationships to ge the current node's group ID.

Anybody has an Idea on how to do this?

Thank you,

Jean-Louis

Read more
Subscribe with RSS Syndicate content