In some websites I need to set the first child as the main page in a section. Imagine 'Products' and when I click on it, I want to show the first product, and a list with the rest. I don´t want to have an introduction for products, and a list with the children.
Is there any way to get this? Maybe redirecting?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | nodehierarchy.patch | 9.38 KB | meecect |
Comments
Comment #1
meecect commented+subscribe
Comment #2
meecect commentedI ended up writing a patch for this. I added a db column, called placeholder, that will let you define (through the regular node edit form) which nodes should be considered placeholders. A placeholder node will automatically redirect to the first child node.
My patch also includes some stuff to allow customization of menu item creation, detailed at http://drupal.org/node/375106 .
Test it out and let me know if you have any issues.
Comment #3
heliotrope commentedHi,
this is a very handy feature.
do you plan to review this patch to get it working with the 6.2 dev version ?
:)
Comment #4
meecect commented@heliotrope
if that was directed at me, then yes, I will probably try to get it working on the 2.x dev version, although, I think 2.x has done away with the nodehierarchy table entirely and is just using the core menu module, so I will have to take a slightly different approach.
Comment #5
heliotrope commented@meecect
I've got it working with the 6.2 branch but in a very nasty way :(
I'm now using the ['options']['attributes'] to save the placeholder value.
I'm a newbie in drupal development.
I'll try to improve the code and will post a patch if I can.
:)
Comment #6
luksakhi everyone
i am also very interested in this. the redirection works with your patch, but the automatic menu creation seems to be broken.
what's your experience?
best regards
lukas
Comment #7
jon betts commentedI'm very interested in this too. There is another module called Menu Firstchild that does this, but it seems incompatible with Node Hierarchy. Is there another way to provide this type of functionality?
Comment #8
luksakI ended up using the core menu module. I have to manually set the child path in the parent.
Comment #9
jbylsma commentedI've used cck_redirection for items that needed to redirect, and it worked pretty well.