drupal 7

Fondazione De Bellat

Sito web drupal 7 css3 html5 custom modules gmap
Siti web valsugana Trento Drupal

Il sito web dellsa Fondazione è stato sviluppato con Drupal 7.

Nella sezione patrimonio è stato integrato uno strumento grafico per disegnare le particelle dei possedimenti e la loro presentazione al visitatore. Le singole proprietà possone contenere fotografie e documenti d'interessse. 

Si è cercato di introdurre alcune caratteristiche di CSS3 come le ombre del testo (text-shadow) o dei font embed (@font-face)

APSP Borgo Valsugana

Il sito dell'APSP di Borgo Valsugana offre un sito informativo ricco e facilmente gestibile internamente. E' disponibile inoltre anche l'Albo Telematico che raccoglie le pubblicazioni pubbliche secondo le normative attuali.

Drupal Deployment

  1. Install Deploy http://drupal.org/node/408774 both on server/client sites
  2. Create a feature with vocabularies, content types, other.. on one site and install on the other. If the entities exists before enabling the feature, consider to delete them and revert from feature
  3. go to admin/content and add content to a plan (create one if it doesn't exists)
  4. deploy

Consuming Drupal REST services

// Pest, rest client
// https://github.com/educoder/pest

include_once "Pest/Pest.php";

$c = new Pest("https://my.servic.es/endpoint");
// Xml specialized
//$c = new PestXml("https://my.servic.es/endpoint");

// Throw exceptions on errors ?
$c->throw_exceptions = true;

// Array with stored request results, body & meta
//krumo( $c->last_response['body'], $c->last_response['meta']);

// login with Session auth
$data = array(
    "username" => "superuser",
    "password" => "superpassword"
);
$raw = $c->post( "/user/login", $data );

Using field api

Change user password for Drupal 7 (take 2)

/**
*
*  set new password for user by uid
*  @param $uid User' uid
*  @param $new_pwd New password
*/

function __change_pwd($uid, $new_pwd)
{
  //global $user;
  require_once DRUPAL_ROOT . '/includes/password.inc';
  $user = user_load( $uid );
  $user->pass = user_hash_password($new_pwd);
  user_save($user);
}

then eg. in index.php, add

__change_pwd(1, "tMp-pWd");

and run once then remove. Write somewhere the password and login again.

drupal 7 css / js cache not working

Drupal 7 offers a great set of caching functionality like CSS and Javascript aggregation. However seems(due a php bug?) in some server enviroment the cached files cannot be written.

In my case I had to delete and recreate both files/css and files/js folders and recreate theme from the ftp account to get it working again.

Ref: http://drupal.org/node/1240256

Alter webform components

/**
* hook_node_load
*/
function {hook}_node_load($nodes, $types){
  // webform id
  $wfnid = 123;
  if(isset( $nodes[ $wfnid ] ))
  {
    $node = $nodes[ $wfnid ];
    foreach ($node->webform[ 'components' ] as &$comp){
      
      if( $comp['form_key'] == 'some_markup'){
        $comp['value'] = "<p>This is a <b>markup</b> content</p>";
      }
      if( $comp['form_key'] == 'my_list'){
        $view = views_get_view( "view_name" );
        $view->set_display("display_id");

Drupal 7 change black background when cropping image

UPDATE 2012-04-23:

(Patch for modules/system/image.gd.inc, imageapi module not needed anymore.)

*****

Drupal 7 views/field jQuery Slideshow plugin

(function($) {
 
    Drupal.behaviors.Slideshow = {
        attach: function (context, settings) {

            var slide = new Slideshow( {
                // debug: true,
                container:  'div.node div.content div.field-name-field-image.field-type-image',
                rows: 'div.field-item',
                images: 'img',
                autoplay: true,
                rowsNavigation: false,
                imagesNavigation: false
            });            
            
        }
    };                 
        
    /*

Pagine

Subscribe to RSS - drupal 7