VS-Code - How to put vscode executable in system path and how to open source code directly in vscode
Introduction VS code is an excellent free IDE for maany types of programming…
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
Introduction VS code is an excellent free IDE for maany types of programming…
While running docker commands with some images, I started getting error: The…
Its good to write unit tests cases, and this part is mostly forgotten by…
Introduction Npm has a tool called: npm audit which reports if your packages or…
Introduction If you working on a github project in a team. Consider you have…
Introduction You already have a content type with one or more fields in it…
In this post, we will see some of the frequently used concepts/vocabulary in…
System design interview is pretty common these days, specially if you are having…
Introduction You are given an array of integers with size N, and a number K…
Graph Topological Sorting This is a well known problem in graph world…
Problem Statement Given a Binary tree, print out nodes in level order traversal…
Problem Statement Given an array nums of n integers and an integer target, are…