Static Website Hosting with AWS S3 and Cloudflare
Static websites have several advantages over dyanamic websites. If you are…
April 18, 2018
See the code below:
function getTerms($category) {
$terms = array();
foreach($category as $val) {
$terms[] = $val['tid'];
}
$result = taxonomy_term_load_multiple($terms);
$ret = array();
foreach($result as $res) {
$ret[] = $res->name;
}
return implode('|', $ret);
}
$query = db_select( 'node', 'n' );
$query
->condition( 'n.type', 'article' )
->fields('n', array('nid'));
$result = $query
->execute()
->fetchAll();
foreach( $result as $row ) {
$nd = node_load($row->nid);
$tags = getTerms($nd->field_tags['und']);
$terms = getTerms($nd->field_article_category['und']);
print 'https://www.yourwebsite/node/'.$nd->nid.','.'"'.$nd->title.'"'.','.$terms.','.$tags."\n";
}
The output will be 4 columns separated by comma. You can save this information in a csv and share this file.
Sample output:
https://www.yourwebsite/node/9,"Advantages of AUTOCAD: Discovering The Best",Autocad,
https://www.yourwebsite/node/10,"Auto CAD: 3D Software That Suits Any Sense Of Style Along With Many Benefits",Autocad,
https://www.yourwebsite/node/11,"Auto CAD For Designing Great Automobile Stickers",Autocad,
https://www.yourwebsite/node/12,"AUTO CAD Where Dreams Meet Reality",Autocad,Autocad
https://www.yourwebsite/node/14,"Brand New Building Technologies That Are Here To Stay ",Architecture|Exterior,technology
https://www.yourwebsite/node/15,"Design Ideas To Make Your Hotel “A Pleasant Stay”",Design Ideas|Interior Design,Hotel|Design|ideas
https://www.yourwebsite/node/16,"A Comparative Analysis Between Modern, Contemporary and Traditional Furniture",Furniture|Interior Design,Furniture|Modern Furniture|Contemporary Furniture|Traditional Furniture
Enjoy
Static websites have several advantages over dyanamic websites. If you are…
Pylint is an excellent tool to have good quality code. This post is not about…
Introduction In a normal email sending code from python, I’m getting following…
Introduction In previous posts, we saw how to build FIPS enabled Openssl, and…
Introduction I needed a report page, where I wanted to have some information…
Introduction I have created a view, with some filters and content fields. I will…
Introduction In this post we will see following: How to schedule a job on cron…
Introduction There are some cases, where I need another git repository while…
Introduction In this post, we will see how to fetch multiple credentials and…
Introduction I have an automation script, that I want to run on different…
Introduction I had to write a CICD system for one of our project. I had to…
Introduction Java log4j has many ways to initialize and append the desired…