Exposing CCK Fields after creating Event - OpenPublish 2.3 RC1

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

Hey Guys,

Excellent job on OP 2.3. I'm having an issue with added cck fields for an Event type exposed on the Full Page Node of Event (Front End). Can you help? or point me in the right direction.

CCK Fields that didn't show Price & Link..

http://www.golocalfun.ca/event/color-moccio

Thanks in advance for any help! - TK

Also, is the video available from San Fran Conference. The training on advance topics specific to OpenPublish. I'm willing to pay if necessary for it or documentation.

Using advanced features to customize your site:

Creating your own theme using the OpenPublish base theme
Using Context to build your site sections
Block placement using Context
Configuring OpenCalais and More Like This
Set up and configuration of Topic Hubs

Comments

You can check your settings

resveld's picture

You can check your settings in admin/content/node-type/event/display

Check if it is excluded or not.
What could be as well, is that you need to add them to your template.

-Ronald

Checked - It must be a Template issue

tkdunning's picture

Hey Ronald,

Explored that option, no additional cck fields are displaying. It seems like OP 2.3 would have an option to display these fields without having to go into the node php file. Let me know if that's necessary.

Cheers... Appreciate your help!

Tom

Hi Tom, I test a little and

resveld's picture

Hi Tom,

I test a little and it seems you need to add some things.

I'll explain what I did here :)

First I went to check the content type and added 2 fields:

1) Label: price Name: field_price Type: Text Widget type: textfield single line
2) Added the resource_link from the existing CCK field as entered by OP Default.

Then go to: admin/content/node-type/event/display
Make sure to not exclude the fields in teaser of full body.

Then I went to check the node preprocessor for event and we need to define the fields there.

So with my editor I edited "sites\all\modules\openpublish_core\theme_helpers\node-event.tpl.inc
I added the preprocessors just above the last {

// Price & Link
  $vars['price'] = $vars['field_price'][0]['view'];
 
if (is_array($vars['field_links']) && !empty($vars['field_links'])) {
    foreach($vars['field_links'] as $link) {
      $vars['resource_links'][] = $link['view'];
    }
  }

Save the node-event.tpl.inc

Then go to: \sites\all\themes\yourtheme\node\node-event.tpl.php and add the following before

<?php
print $related_terms_links;
?>
:

<?php print $price; ?>
<div class="resource-links">
  <ul>
  <?php foreach($resource_links as $link): ?>
    <li><?print $link; ?></li>
  <?php endforeach; ?>
  </ul>
</div><!-- /.resource-links -->

Open up your event and it should be there.

-Ronald

Hey Ronald .. Ok Almost there!

tkdunning's picture

Your advice was excellent. However, probably because I'm not a php guy or missed something, things weren't completely smooth.

--The field contents price and link are showing. However, Price label does not appear beside it (inline).

http://www.golocalfun.ca/event/color-moccio.

-- Also, got this error. "warning: Invalid argument supplied for foreach() in /home/content/d/u/n/..../html/go/sites/all/themes/openpublish_theme/node/node-event.tpl.php on line 40."

Error appears on home page
http://www.golocalfun.ca/

Hey were making progress though.. I mega appreciate any other advice, if you have time.

  • Tom

Tom, Price labels needs some

resveld's picture

Tom,

Price labels needs some adjustment in the node-event.tpl.php:

replace
<?php print $price; ?>

with
<strong><?php print t('Price:'); ?> </strong><?php print $price; ?>

That will set your nice next to the actual listing price.

As for the other issue, please contact me via the form and send your current node-event.tpl.php and i'll have a look.

-Ronald

OpenPublish

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: