Display default drupal field and content of MD Awecontent

Thu, 03/10/2016 - 03:58
#1
Display default drupal field and content of MD Awecontent

Hello,

I  created a node with the fallowing name page--ac--node--dexp_portfolio.tpl.php

And Md Awecontent module working fine but I can't display default drupal fields. 

For example I want to display default drupal field body <?php print render($content['body']); ?> and content of MD Awecontent in page--ac--node--dexp_portfolio.tpl.php.

And my Question is:

How Can I display both fields <?php print render($content['body']); ?> and content of MD Awecontent ?

cindy's picture
cindy
Thu, 03/10/2016 - 05:57

Hi,

- The node built with awecontent only shows fields if those fields are dropped into Awecontent layout 

- You can check function awecontent_node_views line 1633 ->1645 for more detail:

$content = array('#entity_type' => $node->content['#entity_type']);
$content['links'] = $node->content['links'];
$ac_content = $node->ac_content;
$ac_data = drupal_json_decode($ac_content);
$ac_data = _awe_preprocess_data($ac_data, $node);
$content['awe_content'] = $ac_data;
$content['#entity_type'] = $node->content['#entity_type'];
$content['#bundle'] = $node->content['#bundle'];
if (isset($node->content['links']))
$content['links'] = $node->content['links'];
if (isset($node->content['comments']))
$content['comments'] = $node->content['comments'];
$node->content = $content;

Mon, 03/14/2016 - 06:01

Which file I have to look for this awecontent_node_views function?

And How I can print these body field <?php print render($content['body']); ?> ?

Mon, 03/14/2016 - 06:36

I found this function in awecontent.module.

Now how can I print default drupal fields ? 

phuonght's picture
phuonght
Wed, 03/16/2016 - 03:29

Sorry,

Our module does not print default field of drupal in node. If you would like, please customise that section of code to:

$ac_content = $node->ac_content;
$ac_data = drupal_json_decode($ac_content);
$ac_data = _awe_preprocess_data($ac_data, $node);
$node->content['awe_content'] = $ac_data;

Also, we will consider about giving more options to user.

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.