How to upload files on AWS S3 by using curl, without having command line aws or other tool
Introduction There were few files that I need to take backup from a machine that…
March 08, 2018
I have a custom content type, and there are around 2000 number of nodes in my website. In all the nodes, there was no alt attribute in the images. And, it was one of the major SEO disaster that I was facing.
I started updating them one by one. I updated around 10, and I thought of automating that. And, I did it.
$done=0; foreach ($result as $obj) { // I wanted to update 10 articles at once, just to avoid php timeout // Specially, when you have many nodes if ($done >= 10) { break; } $nd = node_load($obj->nid); if ( //field_image_of_drawing is the name of field in the content type $nd->field_image_of_drawing[‘und’][0][‘alt’] === null || $nd-> field_image_of_drawing[‘und’][0][‘alt’] === ” || !isset($nd-> field_image_of_drawing[‘und’][0][‘alt’]) ) { ++ $done;
//just printing node id
print $obj->nid . ', ';
$nd-> field_image_of_drawing['und'][0]['alt'] = $nd->title;
$nd-> field_image_of_drawing['und'][0]['title'] = $nd->title;
//updating the node
node_save($nd);
}
}
Introduction There were few files that I need to take backup from a machine that…
Assuming you have a java project and is using Visual Studio Code as IDE. All of…
Curl is a wonderful tool for initiate REST APIs or calls. Or, you can literally…
Tag the image, by seeing its image id, from docker images command docker tag 04d…
Introduction In your backend and frontend projects, you always need to deal with…
Introduction In this post, we will see how we can build FIPS enabled openssl in…
Introduction This post has the complete code to send email through smtp server…
Introduction In a normal email sending code from python, I’m getting following…
Introduction In one of my app, I was using to talk to . I have used some event…
Introduction So you have a Django project, and want to run it using docker image…
Introduction It is very important to introduce few process so that your code and…
Introduction In this post, we will see a sample Jenkin Pipeline Groovy script…