I tried to use the taxonomy_theme.module, but it does not work with taxonomy_menu at
the moment. My site (taxonomy) structure looks like this.
A (vocab)
AA (term)
AB
AC
...
B
BA
BB
BC
...
I want the theme to change with "top-level" vocabulary. ThemeA for A and its (sub)terms
(A, AA, AB, AC, ...) and ThemeB assigned to B (B, BA, BB, BC, ...). I modified taxonomy_theme.
Becauce it is a really small module, many code needed to be changed. Therefore I renamed
the module to taxonomy_menu_theme. I'm did not test it to life besides taxonomy_theme,
but it is not dependent on it, but a seperate (independent) module.
Hope you like it,
Thilo
Comments
Comment #1
profix898 commentedExtended version to also apply the correct theme even on paths
of node/1234 format assigned to a term/vocabulary :)
Comment #2
profix898 commentedNew version that applies on pathes of
- taxonomy_menu/x
- taxonomy/term/x
- node/x
now. Condition to use:
You want theme selection based on the current vocabulary.
Comment #3
profix898 commentedRenamed taxonomy_menu_theme to taxonomy_vocab_theme.
Because it changes theme based on current vocabulary and its
no longer dependent on taxonomy_menu.
Also made a minor correction to make it compatible with PHP4.
Have fun, Thilo
Comment #4
igrcic commentedTnx for replying so fast for replying for http://drupal.org/node/45412 issue.
Tried to use your newest version of tax_vocab_theme, and in a post before the last, you said that it works for:
- taxonomy_menu/x
- taxonomy/term/x
- node/x
Ok I dont use tax. menu, so first case I dont need. For nodes (path= node/x ) that are in selected vocabulary works nice. But for path taxonomy/term/x it doesnt work, that is, it doesnt change theme, like it does for nodes.
This is what I want, to change it for taxonomy/term/x path. I hope you understand me now :)
Thanks in advance
Comment #5
jvandyk commentedigrcic, I've updated taxonomy_theme for 4.6 to recognize taxonomy/term/* paths.
profix898, if you are going to create a new module, you need to change the variable names in the new module to avoid conflicts. Generally in Drupal we try to avoid forking modules, but rather submit patches to existing modules.
Comment #6
profix898 commented@igrcic
Sorry. I should have noticed ... you need to have taxonomy_context installed
to have themes change with taxonomy/term/x pathes using my module.
(I will look at it again. Shouldnt be too hard to have it work without it.)
@jvandyk
... change the variable names in the new module to avoid conflicts.
You are right, I completely missed that point. Its just because I startet to modify
the module and in the end I got a complete new one.
... we try to avoid forking modules, but rather submit patches to existing modules
As I said above, I tried to modify only. But I realized that the existing module takes
different approach on theme selection. I'm not sure the modules should be merged.
The original one uses terms in a "selector" vocab, but my module chooses the
themes to apply based on the vocabs itself. What means every vocab can have a
different theme, but not the terms in it. I think the two points of view are not
compatible to be integrated in one module. What do you think? You will see that
nearly the whole module code has changed somehow. Of course the basic structure
is still the same. I will modify the variable names to avoid conflicts. We can talk about
combining the codes, of course.
Sorry. It was not my intention to displace the existing module in some way.
I just thought some people need what I needed and find vocab_theme useful.
Thilo
Comment #7
profix898 commentedMaybe both modules could be merged. And the user decided via radio box or
what selection method he wants. Or with two check boxes what methods to
be active. In principle both methods can be activated at once, but I cant see
what for.
If a node is in a ThemaA vocab but has a term for ThemeB applied also,
what theme should be selected by the module? Possible solution:
- give priority to one method
- uses default theme in case of conflict
- ???
Comment #8
profix898 commentedNew version available.
I merged the two variations of theme.module. The user can select now which method
he/she needs or prefers. I also updated the original taxonomy_theme code to support
taxonomy/term/x pathes and my code to support it without taxonomy_context being
enabled. The new module should support
- taxonomy_menu/x
- taxonomy/term/x
- node/x
for both (term- and vocabulary-based) selection methods.
Feedback is welcome. Hope you like it.
Thilo
Comment #9
profix898 commentedSeems like I published the wrong version :( Sorry.
So this is the right one ... I hope ...
Comment #10
profix898 commentedUpdated again to allow selection of all installed themes instead of
enabled ones only as requested in http://drupal.org/node/40643.
Comment #11
profix898 commentedUpdated again to assign themes to forums (http://drupal.org/node/45741).
Hope all options are (still) working, because of many code changes.
Comment #12
igrcic commentedhi profix898, tried it and it works nice. i needed that part with forums :) but i need something else, and i changed original taxonomy_theme module a bit. can u please take a look at my module here, with it you can select themes for ALL terms in ALL categories/vocabularies. maybe u can put this option too :) just change all variables names from taxonomy_theme to something else, so they doesnt mix with original taxonomy_theme module.
Comment #13
igrcic commentedman, i always forgot attachment :)
Comment #14
profix898 commentedHi igrcic!
I dont understand what you need the additional modification for!? In case you want
to assign different themes to different "sections" (vocabularies) of your site, you can
use vocab-based selection. Whenever you need more detailed configuration you can
create a vocab "themes" and add a term for every theme. On your pages you can
assign one term to apply a specific theme and one term for your navigation. I think
your "or ALL terms in ALL categories" mod is someway redundant to term-based
selection. For your forums you can individually choose themes anyway.
What point do I miss? What specified use does your idea assign to?
Of course, I can agree to your proposal and integrate it with taxonomy_module,
but I think we should discuss its use for other users before.
Thilo
Comment #15
igrcic commentedwell my users dont have to have an option to select a theme also!
my modified theme works perfect for me, you dont have to integrate it! thats only what i wanted :)
thank you and original author for nice module!
Comment #16
profix898 commentedLast night I had some time and thought over it again. And it doesnt hurt to have an extra
"ALL terms in ALL categories" option. Because I have no better idea how to call it I chose
"all taxonomy" title for this option. I also grouped the different parts of module settings
with form_group (very nice idea ;) ) and optimized some parts of the code.
I think this module will be available on the project page in a few days.
I'm also working on a 4.7 version. Of course, the groups will be collapsible in that version.
Comment #17
profix898 commentedand i always append an erroneous attachment :(
Comment #18
liquidcms commentedAny idea on your eta for 4.7 version? I was going to start looking at doing it and then saw your posting here suggesting you were already working on it.
I haven't used tax_theme before; but sounds like exactly what i need... but had already started a new site with 4.7 - because i wanted some of the new 4.7 features, wanted to use it as a 4.7 test site.. and just cuz i like using the latest and greatest. I have converted over a couple mods to 4.7 so far - but no idea how much work for tax_theme. I am sure you would do a better job than me.
cheers,
peter....
Comment #19
profix898 commentedYes, I already have a working 4.7 version of taxonomy_theme. But I'm still waiting
for my cvs account to add the new version to repository. I hope to get it the next
days, so that I can take maintainance for taxonomy_theme. You are welcome to
test the module from attachment by now.
Comment #20
liquidcms commentedvery nice.. i tried it and it does at least allow me to set settings... once i figure out how to use the mod i will test it a bit more.
thanks a ton,
peter...
Comment #21
profix898 commentedAgain I found some bugs in the posted code. So please try this version instead.
The zip archive contains taxonomy_theme for Drupal 4.6 AND 4.7.
Comment #22
profix898 commentedAll modifications of the extended taxonomy_theme module have been
committed to cvs and are included in the latest 4.6 and 4.7 releases.
Comment #23
(not verified) commented