Home

Primary links

  • top o the deck
  • Drupal for Beginners
  • about
  • links
  • give me some sugar

Drupal stuff

  • EDAM
  • STARDOM
  • Question Bank
  • Drupal musings
  • Drupal tips
Home

Key stuff on this site

Easy Drupal Admin Manual (EDAM)

SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)

Drupal for Beginners

Subscribe to posts by RSS or email

Subscribe to Drupal Ace by RSS feed RSS feed 

Subscribe to Drupal Ace by Email

Donate towards my web hosting bill! Get a great host!

Share and save

Share/Save

Random piece of content

Welcome to Your Site

Manuals on this site

  • Easy Drupal Admin Manual (EDAM)
    • Welcome to Your Site
    • First Steps: Please Read!
      • Understanding These Instructions
      • Important Terminology!
      • Best Practices for Site Admins
    • Super Quick Guide (for the experienced and the brave)
    • Logging In
    • Your Administrator Tools
    • Setting Site Basics
      • Setting Site Information
      • Configuring Your Theme
    • Creating Content
      • Node Types
      • Create a Page Node
      • Create a Story Node
      • Create a Blog Entry Node
      • Making Images and Other Files Available
      • Using Text and Image Editors
    • Organizing Your Content
      • Terms, Vocabularies, and Taxonomy: "Tagging" Your Content
        • Taxonomy Suggestions
      • Menus, Links, and Paths: Navigating the Site
        • Content Paths and URLs
        • Creating Links
        • Working with Menus: Administration Form (Drupal 6)
        • Working with Menus: Administration Form (Drupal 5)
        • Creating Menu Items on the Fly
        • Placing Menus on Your Pages
      • Placing Content on pages
        • Creating a page from a Single Node
        • Creating a page from a List of Nodes
        • Setting the Front Page
      • Working with Blocks
    • Maintenance Stuff
      • Maintenance and Construction Notices
    • Other Fun Things
      • Changing Color of Garland Theme
      • Free Aliases!
  • SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)
    • Set a Clear Goal
    • Make a Good Site
      • Put out the Welcome Mat
      • Make Great Content
      • Build a Great Brand
      • Make Navigation Easy
      • Tune Site Performance
    • Drive Traffic
      • Promote your Site
      • Get Found with SEO
    • Build a Community
      • Build an Offsite Community
    • Monitor and Improve
    • One-Page Checklist
    • Drupal and the Blogging Starter Checklist
      • Drupal and the Blogging Starter Checklist, Part 1
      • Drupal and the Blogging Starter Checklist, Part 2
      • Drupal and the Blogging Starter Checklist, Part 3
      • Drupal and the Blogging Starter Checklist, Part 4
      • Drupal and the Blogging Starter Checklist, Part 5
      • Drupal and the Blogging Starter Checklist, Part 6
      • Drupal and the Blogging Starter Checklist, Part 7

Recent comments

  • Deleting cookies

    Good point; thanks! Deleting cookies and/or caches, depending on the problem at hand, is a part...

  • It worked

    adding $GLOBALS['tempUser'] = $user; worked but I find it worth noting that I had to delete...

  • very good document...

    very good documentation for beginners!!!!!! thanks!!

  • del penitential 62

    strike out abject
    eliminate penitent 5

  • Chat

    Thank you a lot about very beneficial to my work was very useful thank you

more

unanswered question

How to fix broken image paths when changing download method from Private to Public?

Submitted by Drupalace on Tue, 2009-09-15 16:11
  • Drupal 6
  • images
  • unanswered question
Questions

This is a long-running question I've had. I can't find a forum post with exactly the same question, though this one comes close: http://drupal.org/node/489850

I have a site that's used the Private download method from the start. I'd like to switch to Public, so I can enable CSS optimization. Easy enough to do, and most images – logo, and images inserted into text via TinyMCE – are unaffected.

But I also have many nodes with images attached via the Images module, which adds an "Attached images" upload option to nodes. (Side note: Why it's labeled "Attached images" when it appears to allow attachment of only one image, I don't know.) Paths to those images break when switching download methods (which, fairly enough, warns in advance of such trouble).

Click here and read more!
Related URL: 

http://drupal.org/node/576732

Question answer: 

As of January 2010, I have no answer to the problem – but suddenly have no problem, either. In the kind of unsatisfying conclusion that happens time and again, I find that I can now change all affected sites to Public download, and even enable optimization of CSS and Javascript at Administer » Site configuration » Performance (which was the point of it all). After doing so, images display normally – even though the images still have the screwy addresses, like http://www.site.com/sites/site.com/files/images/image.png, that earlier resulted only in "image broken" placeholders.

That's if I'm logged in. If not logged in, image addresses have the nice expected form http://www.site.com/system/files/images/image.png. Can't these images make up their minds? But either way, they seem to display just fine.

So, what gives? I can't say. I don't recall making any major changes to the system that would affect this; perhaps it was simply an upgrade to the Image module somewhere between then and now (I'm currently running 6.x-1.0-alpha4).

If you've had this same problem, all I can suggest is trying the change from Private to Public again, especially if you've made any changes to Drupal or modules recently. Who knows, it just may suddenly work. 

  • 3 comments

Why would Color-enabled themes work for all sites but one?

Submitted by Drupalace on Fri, 2008-09-12 14:37
  • Drupal
  • modules
  • theming
  • unanswered question
Poll

The problem: Themes that are "recolorable" with the Color module are working fine on my sites B, C, D, etc., but not site A. On that site, *choosing* a new color scheme works fine, but those new colors just won't show. Here's why it's strange:

Click here and read more!
Related URL: 

http://drupal.org/node/306993

  • Add new comment

How to export and import Book nodes?

Submitted by Drupalace on Tue, 2008-06-24 16:38
  • content
  • Drupal
  • unanswered question

I 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.

So I tried anyway exporting from 5.x using Export DXML, and then tried to figure out a way to import... but upon installing Export DXML, I got only a setting for whether or not PHP is also exported. That's all – no commands I can find to actually initiate an export, nothing. The module's documentation says zilch too. What should I be looking for in Export DXML to actually perform an export?

Or, given the lack of 5.x modules for import/export, perhaps there's some built-in method for importing and exporting Books in 5.x that doesn't require third-party modules. Am I missing something obvious?

Related URL: 

http://drupal.org/node/204367

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 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!

  • Add new comment

What are general methods to enable fields for input by visitors?

Submitted by Drupalace on Thu, 2007-12-06 12:45
  • Drupal
  • questions
  • unanswered question

Drupal's many node types are great for making all kinds of content, and CCK multiplies the possibilities many times over.

One thing I can't quite grasp, though: Is there some general, built-in method for enabling individual fields that allow visitors to input data?

To clarify that, let me first note what I'm not talking about:

Click here and read more!
Related URL: 

http://drupal.org/node/194932

  • 5 comments

How to display message (NDA, warning, etc.) before content can be viewed?

Submitted by Drupalace on Thu, 2007-12-06 12:35
  • Drupal
  • questions
  • unanswered question

Say a user wishes to view a certain piece of sensitive content. How can we have the site first respond with a notice, before the content can be viewed?

Specifically, I'm looking to have the site respond with a simple NDA (Non-Disclosure Agreement) before displaying certain nodes (and even then, only to registered users, of course). But I can imagine many more uses: displaying conditions and terms related to the content, displaying an age warning for... er, more delicate content, and so on.

Click here and read more!
Related URL: 

http://drupal.org/node/194940

  • Add new comment
  • 1
  • 2
  • next ›
  • last »

Learn Drupal, hands-on

Get the beginner-friendly ebook that teaches community site building via a live case study.

Drupal 6 Ultimate Community Site Guide

Read the review

Drupal mini tip

The Book module creates "Printer-friendly version" at the bottom of Book pages. If you hit that link from a page with child pages, Drupal creates a printer-friendly page from that page and its child pages. If you hit the link from the Book's top page, you get the whole book in a single page!

It's a deal!

Dreamhost dealsDrupal Ace presides over his domain, proudly ensconced in his DreamHost eyrie. Won't you join me?

Promo code deal!

Just enter the code 49ER when you register for an account, and save $49 off the already-low price. No strings!

Read my hosting service review

Powered by Drupal, an open source content management system

Copyright 2007 and forever after. Made with Drupal, of course. On OS X, of course. Served up by DreamHost. DreamHost

RoopleTheme