0

OK, After some research and since Domain_views module seems to be a little bit buggy (printing always default Domain ID no matter what), I think this is the base question solving my problem the other way around with 2 domains and 2 themes using the same nodes from same node-type, but they both need different image-styles because of their 2 different themes:

How do I alter the given image-style of a given node-type in its default full-node view-mode in the .tpl files of a theme, to have 2 different used image-styles in 2 different themes by the same node-type and the same view-mode?

I've tried to find example themes doing it and I heard of Entity view mode to add custom view modes, but I am still not sure if I am on the right tracks. Actually I only need another image style (size) for the same node-type and the same view mode but in 2 different themes since Domain Access gives me hard times to solve this with conditional view modes or Views displays.

From what I understood there are 2 ways:

  • a custom view mode for the same node type and a function in the theme telling the node-type to rather use this view mode

  • or only a image-style altering in the node--full.tpl.php but I can't find a good example explaining it.

The very basic question to research for me is: how to alter image-styles in the code of the theme layer? Is this correct?

Any help would be very appreciated! Thank you very much for any hint.

0

Well after reforming my question 3 times and rethinking what the actually question should be like to find a solution, I came to the conclusion that the Domain_views module is completely broken (ALL Domain views fields always output the default Domain ID/name/path no matter what), and that the theme layer node--view-mode.tpl.php altering approach is not generic enough to have this functionality in other use-cases.

So I found a nice trick, which maybe also helps others to change field styles in a given steady node-type and same view mode under certain conditions, but it needs Views module:

Use the Views_conditional module and use your fantasy to get the needed result. :-) That easy!

In my case I was able to turn off the Domain_views module completely (finally!) and have used the absolute path setting from the content:path views field to change the image-style under the condition, that the path includes a given pattern of one of my domains. I have 2 image fields (excluded in Views) and a conditional field showing one of them if needed, e violá! :-) My image style changes in the 2 different domains by the same given node-type and node-view-mode! Awesome

Views as a full node view mode designer... I never stop learning. ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.