Here is a sample code to create a new page node in Drupal with the “node_save()” and adding the pathauto page.
// Bootstrap Drupal
include_once ‘includes/bootstrap.inc’;
include_once ‘./sites/all/modules/path/path.admin.inc’;
include_once ‘./sites/all/modules/path/path.module’;
include_once ‘./sites/all/modules/node/node.module’;
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$node = new stdClass();
$node->type = ‘page’;
$node->title = “Page Title”;
node_save($node);
$node = node_load(array(‘title’=>$node->title));
$path = “node/” . $node->nid;
$alias = “some/specific/path”;
path_set_alias($path, $alias);
Related Tech posts:
- Drupal Admin Page Is Blank
- How to import data into drupal?
- How to install google map in drupal?
- Drupal “Page Not Found” Error on ALL Pages
- Drupal XML sitemap not building
- Basic Drupal Modules for a Website
- How To Store Session Cookies in Drupal?
- How To Move The Exchange CMS To Passive Node From Active Node?
- Drupal Installation