Parameterized side content - use blocks or go custom?

Hi all,

I've tried searching the site for what seems like a fairly obvious task - having blocks take arguments to display differently depending on the context they appear in. I see the question asked again and again, but without an answer. I simply can't believe it cannot be done, so here goes.

I should note that I'm new to Drupal, but used to be good with PHP once, and have plenty of other programming experience.

I'm building a site where I'm displaying information about people. I have a custom module that handles requests of the form /people/Firstname-Lastname, and the content of the page is generated based on the values of Firstname and Lastname. So far so good.

But then comes the apparently tricky part. On a page displaying information about a specific person, I want a lot of the blocks surrounding the main content to contain data related to the person in question. For instance, I want to display blocks that list the latest articles written about that person, a twitter feed based on the person's registered twitter nick, and a block displaying info about the person retrieved from a call to an external API.

Field with multiple values — display HTML based on value count?

Hi there,

I've got a field (field_image_1) which allows multiple values. I'm using the following code in my template.php to override the template and output the content as an HTML list for use in a JS slideshow.

<?php
function mytheme_field__field_image_1($vars) {
  $output = '';

  // Render the label, if it's not hidden.
  if (!$vars['label_hidden']) {
    $output .= '<h3>' . $vars['label'] . '</h3>';
  }

  // Render the items.
  $output .= '<ul class="slider" id="folio-slider">';
  foreach ($vars['items'] as $delta => $item) {
    $output .= '<li class="slide">' . drupal_render($item) . '</li>';
  }
  $output .= '</ul>';

  // Render the top-level DIV.
  $output = '<div class="slidewrap clearfix">
  
  <ul class="slidecontrols">
	<li><a href="#folio-slider" class="next">Next</a></li>
	<li><a href="#folio-slider" class="prev">Prev</a></li>
  </ul>
  
  
  ' . $output . '</div>';

  return $output;
}
?>

<?php
function mytheme_preprocess_field(&$vars, $hook) {
  // Add specific suggestions that can override the default implementation.
  array_unshift($vars['theme_hook_suggestions'], 'field__' . $vars['element']['#field_type']);
}
?>

It all works fine — except the slideshow controls (ul class="slidecontrols") display when there is only one value.

Fatal error: Call to undefined function node_load() in /var/www/example.com/www/includes/menu.inc on line 579

Hi,

I was upgrading contributed model as I accidentally copied Drupal 7 installation folder to /sites/all/modules. I have been getting following error since running upgrade.php

Fatal error: Call to undefined function node_load() in /var/www/example.com/www/includes/menu.inc on line 579

Is there any possibility to fix it?

Thanks, Martin.

Help with changing host.

Hi
First sorry for the broken English, i hope i make myself clear.

I have a drupal 7.2 site up and running, everything is fine but the host is slow.
Because of that i change to new host.

The new host is very fast compared to the first one, and from a visitor point everything is fine and fast.
But from behind the scene, i have problems.

It is not possible to run update.php, open up the configuration page, and the Status Report page.
Everything else in the admin seems to work fine.

Everytime i push the status page, config page or run update.php i get the following error:

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/www.site.net/www/includes/file.inc on line 1975

Where line 1975 wil differ from time to time.

I dont have access to the shared server and support says its not possible for them to change the timeout.
I search the forum and tried several tips, to change the timeout, and it may have worked, but then instead of the above error, after some time i just get wsod.

I also tried to disable every single module, no luck.
I cleared caches, no luck
There is no entries in the "recent log messages", after the bsod or the error, everything seems fine.

When changing host, all i did was export the database and save all files.
Then import database and upload all files to new host.
Changed the settings.php and then im ready.

Body field disappears

I have a problem on one site where users can enter content into the body field when adding a forum topic, but then it disappears. The body is gone, whether we view or try to edit the node.

This also occurs when we enter content into the body field in a custom event content type.

How to adjust the number of allowed vote(s) in the poll?

How to set or limit the number of allowed vote(s) in the poll module in 7.x? Since we cannot edit the poll_settings field from Poll UI, how can we adjust the the default(1 vote only from many entries). What if we want to increase the default votes to 2 or more from the total number of entries or candidates. For example, what if we want to vote 10 coucillors out of 20 candidates, how do we adjust the number of allowed votes from 1 to 10?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x