Hi,

After searching and searching and then searching again, I realised that there is no documented answer to this, so I decided to ask here.

I want to print taxonomy terms from my Content Profile (content type called "profile") in my Author pane block. Using this awesome tutorial I managed to separate taxonomy terms so that they are printed separately depending on taxonomy.
So, I have a tags vocabulary called "Interests" and I print them out in node-profile.tpl.php like this:

	  <?php if (count($interests)): ?>
	  <?php print t('Interests ') . $interests; ?>
	  <?php endif; ?>

... and it works.

But then I try to print the same terms in author-pane-block.tpl.php with

<?php $node = content_profile_load('profile', $account_id); ?>	  
	  
	  <div class="author-pane-interests">	  		
	  <?php if (count($node->interests[0]['value'])): ?>
	  <?php print t('Interests ') . $node->interests[0]['value']; ?>
	  <?php endif; ?>	  
	  </div>

...and nothing happens.

Am I missing something?

I noticed that there's plenty of information on how to print CCK fields from Content Profile, but there's no documentation or code snippets on how to print content profile's taxonomy terms.

Please help.

Thanks in advance!

Comments

Michelle’s picture

Status: Active » Postponed (maintainer needs more info)

I can't possibly document every last thing someone might want to add to Author Pane. The docs already cover everything AP provides and then some.

Anyway, I don't see anything jumping out at me as being wrong. Best thing to do is make sure you have the Devel module installed and see where it's going wrong. Put a dsm($node) after you load the node to make sure it's getting loaded. Then drill down into it to see if there's anything in $node->interests[0]['value'].

Michelle

Michelle’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

No further comment from OP and I've provided all the help I can.

Michelle

drupalina’s picture

Title: How to print taxonomy terms from Content Profile? » How to print the taxonomy terms from Content Profile?
Status: Closed (won't fix) » Active

I'm sorry to re-open this issue, but I have really looked and looked and searched and searched -- and there's no answer out there to this simple and much-needed question.
http://drupal.org/node/917738 for example documents how to add CCK fields from Content Profile, and there's plenty of documentation on how to bring in Profile fileds from the core profile module. But what if the profiles are linked together through simple taxonomy terms in CP node? There's nothing out there that will tell us how to print those taxonomy terms for a given Content Profile node inside the author-pane-block.tpl.php.
PLEASE-PLEASE help --- I've been wrecking nerves over this (almost in tears) for days and weeks -- and nothing works!

Michelle’s picture

Did you do what I suggested in #1? If you don't respond to the help I give you, I don't know how to help you further. I'm not a mind reader.

Michelle

drupalina’s picture

Thanks Michelle,
Yes, I did as you suggested in #1, but that yielded no results.

Nevertheless, after trying various combinations, I've just managed to get it to work (I think). So if any folks run into this problem in the future, here's the code that I used

<?php
  $vocabularyName = $variables['content_profile']->get_variable('profile', 'vocabularyName');
  print $vocabularyName;
?>

(this assumes that your contntent type is called "profile" and the vocabulary is "vocabularyName")

I don't know what this quite means, or whether it is a bad code, or whether it will slow down the performance, but at least it prints the terms in that vocabulary.

Michelle’s picture

Status: Active » Fixed

I have no idea... This is really a Content Profile support issue, not an Author Pane one, and I'm not familiar with the internals of CP. If it's working for you, I guess this is fixed. If you have more problems, I suggest asking in the CP queue.

Michelle

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

wfendler’s picture

Project: Author Pane » Content Profile
Version: 6.x-1.1 » 6.x-1.x-dev
Component: Documentation » Base module
Status: Closed (fixed) » Active

Really need some help on this.

This is kind of the result I'm trying to acheive:

<?php 
	if ($node->field_career_field_taxonomies[66]["name"]) {
	  print 'Career field(s): <a href="#" title="">' . $node->field_career_field_taxonomies[66]["name"] . '</a>';	
	}
?>
<?php 
	if ($node->field_career_field_taxonomies[67]["name"]) {	
	  print ', <a href="#" title="">' . $node->field_career_field_taxonomies[67]["name"] . '</a>';
	}
?>
<?php 
	if ($node->field_career_field_taxonomies[68]["name"]) {
	  print ', <a href="#" title="">' . $node->field_career_field_taxonomies[68]["name"] . '</a>';
	}
?>

Each profile is allowed up to three terms. If someone could tell me a simple way to print the terms and tid's I would be so thankful!