Help with setting up a view using $arg

Hi,
I'm currently building a site that is going to be a repository for resources.

The resources will be of a set content type. This could be an image, a video, a lesson pack (zip) etc.

Each resource can be assigned to multiple taxonomy terms such as Biology, Chemistry, Maths etc.

Each taxonomy term has it's own colour scheme, set up using a set of blocks that change based on the URL. For instance, if the user is in the Biology section then they get the biology blocks which are green.

I have set up views using $arg to automate this. So
$arg/images changes to biology/image or maths/images dependent on the link that has been selected. All of these links have been set up as URL aliases.

It works ok, if the user selects the biology images page then they get the biology/images view, styled correctly in the biology colour scheme.

What I'd like to achieve however, is when the user clicks on the title to link through to the node I'd like them to remain in the biology colour scheme. I can't force the node to be biology because it can be in more than one category.

Is it possible using a new view for node where I could use something like $arg/$arg/node/$arg so when they click on the link to the node it appears at biology/images/node/nid rather than going straight to /node/nid ?

This is driving me up the wall and I'd appreciate any help.

Comments

Hitby’s picture

Sorry, forgot to mention, Drupal 5.7 running on a local apache server (if it makes any difference :) )

yan’s picture

I'm not sure, but the Taxonomy Theme module might help you. It lets you choose a different theme based on content type, taxonomy term/vocabulary or URL.

Hitby’s picture

Hi thanks for replying. I've had a look at that and unfortunately it only allows you to change a complete theme. All I want to do it change some blocks. I.e. I have a header and footer block for each section that are loaded when the url contains the name of that section.

Any more help would be much appreciated indeed.

Cheers
Dan

yan’s picture

unfortunately it only allows you to change a complete theme

Right, but a "complete" theme could also be a subtheme, i.e. just a css file in a subfolder of the parent theme. That might work, although it's not the best solution.

shanefjordan’s picture

I wanted to do something similar to this. I wanted the image to change based on the page I was on, but only if it was specified. So, I used CCK and created a text field to cotnain the image text. Then I populate the url of the image into that field when I create a page.

In my style, I do a check and if the field is not blank, then I display that image, otherwise I display the default image. Something like that may work for what you doing, it may not. I didn't want to create a new theme for each page, or even a subtheme for each page.

Thanks,
Shane

Hitby’s picture

I'm very new to drupal (started with it last Friday!) so please bear with me.

Is it possible to simple move the node dependent on the referring page?
If I visit site/node/1 from site/biology/images the node becomes site/biology/images/node/1 ?
Same for the other sections ie. if visited from maths/images it will become site/maths/images/node/1 etc

This would pull the correct stylesheets and blocks for each section. I think my difficulty stems from having resources available in multiple sections

Thanks again. If I can figure this out I'll be a huge step forward. If not, I'm not sure I'll be able to stick with drupal. The way I currently do it is to have the records flagged for each section and then run a different SQL statement in each section ie. SELECT * FROM resources WHERE category ="biology" AND contentType ="image"

This would also allow my sidebar menus which change for each section to remain on the page. Currently they dissapear