Extra options - select user and taxonomy for new pages

dman - January 28, 2006 - 01:13
Project:Import HTML
Version:HEAD
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Via debtman7 (http://drupal.org/user/22773)

> 4) An option for user to import as, and perhaps taxonomy term to use,
> would be handy.

I've got some more plans for taxonomy setting, but this would make sense...

#1

L0rne - October 7, 2006 - 09:00

I would love to be able to assign newly created nodes to particular taxonomy categories! I've been playing with this, but have not been able to get it to work.

I have also found it useful to be able to set publishing options (published, promoted, etc). I was able to hard-code the settings I wanted for these, but a form element for this would be great.

Thanks!

#2

dman - October 8, 2006 - 04:45

It's on the wish list. Please feel free to give it a go. Shouldn't be too tricky.
Add a form element to the import page, much like the menu root selector.
Tag it in the code during the node build, and saving should just work.

When thinking of this, I'd also thought of fixing up a bulk category assignment page, but that's a different project. I ended up doing neither.

#3

L0rne - October 13, 2006 - 06:51

Here are a few things that I added to import_html.module for my own purposes; I hope they will be of use to someone.

Under "administer" -> "import HTML" I added three new form elements

  • A multiple-select list of taxonomy terms.
  • A checkbox for selecting published/not published
  • A checkbox for selecting promoted/not promoted

Other publishing options might easily be added; these were useful for my project.

I have attached a patch file. Comments and criticisms greatfully accepted!

AttachmentSize
import_html_taxonomy_publishing.patch 3.35 KB

#4

dman - October 13, 2006 - 14:42

Cool, I've patched that in.

I shifted the bit where it adds the new properties to the node into the bit where the node is built and the other properties (body/title/teaser) are being added - _import_html_process_html_page()

It was happening a bit late in the process where you had it, (immediately before the save) and was causing errors for re-imports.

Otherwise, seems to work.
I tweaked a few other bits while I was there. Gosh I left a lot of debugs in there! Code looks a mess. Still, they come in handy , you're in no doubt about what's happening.

Anyway. New version in CVS now.

.dan.

#5

dman - January 30, 2007 - 10:31
Status:active» closed

Thanks for the inputs. They've been working well for a while now (although I shifted them into a subroutine)

#6

dman - February 12, 2007 - 23:47

I've patched in user selection support
Current version diff
Not fully tested, but did the job.

 
 

Drupal is a registered trademark of Dries Buytaert.