content
Taxonomy Suggestions
Taxonomy suggestions
You can create whatever Terms you can think of a use for, grouped into whatever Vocabularies you like. There are infinite possibilities – which always makes it hard to get started.
General strategy
It's difficult to immediately envision all the ways to set up your taxonomy, and all the possibilities for using it. Here's a general suggestion for starting out:
How to export and import Book nodes?
Posted June 24th, 2008 by DrupalaceI wanted to move a Book from one site to another. I see a couple of modules that look up to the task – Book Import and Export DocBook – but they're for 4.x only. For 5.x, I see Export DXML. Yet the scant description online (http://drupal.org/project/export_dxml) says that Book Import (the 4.x module) is used to then import the exported content. Hmm.
Question answer
This plea of mine on the Drupal.org forums got no response but the dolorous sigh of a forsaken wind. Just as I was about to retreat to bitter existence's sole comforting shoulder – I'll always be there for you too, Wild Turkey – the kindly and knowledgeable GR stepped in by email with ideas.
I headed to phpMyAdmin (which used to scare me but I'm better now, thank you), called up my donor database that held the Book captive, and used this SQL command:
select * from 'node' where type='book'
which selects all records from the node table, of type 'book'. I exported the results into a file.
Then I went to the hot-with-anticipation recipient database and attempted to import the file. The returned message started as follows:
INSERT INTO `node` ( `nid` , `vid` , `type` , `title` , `uid` ,
`status` , `created` , `changed` , `comment` , `promote` ,
`moderate` , `sticky` )
VALUES ( 13, 13, 'book', 'Understanding These Instructions', 1, 1,
1168408293, 1188227828, 2, 0, 0, 0 ) ,...
... and so on, for 40 or so book records within VALUES. But it then all failed with the error:
#1062 - Duplicate entry '13-13' for key 1
Apparently, the first record, which has nid (node ID) 13 and vid (version ID) 13, ran up against an existing node that also has nid 13 and vid 13. Like two Jean-Claude Van Dammes in Timecop, these cannot exist in the same place at the same time without results most distressing.
Interestingly, the clash didn't involve any existing Book nodes, as the site in question (this one!) had no Book nodes. So the existing node fervently laying claim to nid/vid 13 wasn't a Book node, but apparently that makes no difference.
I figured that I needed some way to change the nid/vid numbers of the old Book nodes before exporting them. Back to the donor site's database. GR helped out with the SQL here:
update node_revisions set nid=nid + 1000000 where nid in (select nid from node where type='book');
then
update node set nid=nid + 1000000 where type='book'
(I like the audacity of the numbers! Works for me: if we're going to artificially boost the ID numbers, let's kick the buggers up into the bloody ionosphere.)
That done, I went and did the same for vid too (replace nid with vid in the above). And once again,
select * from 'node' where type='book'
and export.
GR reminded me that I need to export and import not just from the nodes table, but from the node_revision table as well. So I did the same updating of nid/vid within that table, then the export procedure, all replacing node with node_revision.
Next up: you guessed it, head to the recipient database and import my files containing the above exports.
Solved?
Alas... things weren't quite licked. The nodes didn't function properly as Book nodes. They showed up as content, but the imported Book structure didn't show up in any way under admin/content/book. And when editing or creating a Book node, none of my imported Book nodes showed up under the drop-down Parent field – i.e., there wasn't a way to recreate the actual structure of the book. The nodes were there, but they weren't right. ("The nodes are sour", a crusty Maine character might deliver in a Stephen King yarn.)
Well, around there I cheated, and brought over my Book the really old-fashioned way: cut'n'paste from the donor site into fresh new Book nodes on the recipient site. (Those are, by the way, the Easy Drupal Admin Manual.) I had a lot of editing in store for each node anyway, so a one-step mass import wasn't an utmost requirement. Still, a chagrined Ace I am.
Sleuthster GR suggests that I left a third vital table out of the process: the books table, which also needs its nids/vids changed, and its content exported and imported, like the other tables above. Hmm, a table called books... that does sound suspiciously important to the task at hand. Chagrined and red-cheeked I am.
That extra step may have done the deed, but I had already embarked upon my more Luddite methods, and since then have not had cause to attempt a fresh export and import of a Book. So I'm going to leave this one an Unanswered Question for now, simply because I can't yet verify the whole proper process. But I hope this tale, and GR's assistance, will help someone else complete the task. Please write in if you have experience or ideas here!
Another method?
The helpful boris-doesborg suggests here that two modules that may provide a solution:
http://drupal.org/project/importexportapi
and
http://drupal.org/project/node_import
I don't have need or opportunity to experiment with these now, but if anyone out there does, please report!
Testing Hidden Node Title
This is a page I'm creating to test the technique for hiding a node title, given at How to hide a node title?
This page's title is "Testing Hidden Node Title", but you should see it without any title appearing in the usual place.
Creating a page from a List of Nodes
You'll often want to make a page not from a single node, but from a list of several nodes. I haven't yet come across a technical Drupal word for such a page, so I'll call it a 'node-list page'.
Creating a page from a Single Node
There's not much to cover here. As already discussed, when you create a node, Drupal automatically gives it a path (like node/53), or you can give it a path yourself (like product_catalog).
To create a page from that node, then, you don't really need to do anything special. Just go to the node's path (presumably via a menu item you've created for the purpose), and Drupal will whip up a page centered around that node, surrounded by the blocks, graphical elements, footer, and other accountrements you've set up for the site.
That's it!
Placing Content on Pages
First, a note:
Following common writing practice, I'm capitalizing words in the titles of EDAM pages. This perhaps isn't a good decision, though, as elsewhere in the text I try to make some clear distinctions between certain capitalized and uncapitalized words.
In this EDAM entry, the title "Placing Content on Pages" refers to placing content on any web page (uncapitalized, generic meaning, not the special node type Drupal calls Page).
End tangent.
Placing Menus on Your Pages
-- coming later --
Creating Menu Items on the Fly
The Menus administration form is one place where you can create menu items (see Working with Menus: Administration Page).
There's another way to create a menu item: when you create or edit a node, you can create a menu item for it on the fly.
For example, you create a node with company information, and want a link to that node to appear in a menu called 'site menu'. You could create the node, head to the Menus administration form, and create a new menu item within the menu called 'site menu'.
Working with Menus: Administration Form
Menus are the key to your site – they're the way by which visitors get at your content.
A menu is a list of links to content. Menus can appear in a horizontal line at the top of your pages, as with many web site designs. Or they can appear along the sides in blocks, another common design.
A specific link in a menu – a "menu item" – can link to a specific node. Or, calling on the full power of the database behind your site, it can pull up a list of nodes based on some criterion.
Content Paths and URLs
How do people get from one page on your site to another? Links, links, links!
But what is a link? It's just an instruction for the browser to jump from the current page address, to a new page address.
You can create links to any page whose address you know. So how to you find, or create, the address for a page? If you want to know, here's your guide. (And if you already know the address for your target page, and are ready to create a link to it, jump ahead to Creating Links.)












