0

I'm using Domain Access module and I have different logo for each domain. I have setup logo for each domain in domain theme settings.

I have view which lists all the domains (over relationship with user profiles, because each user has it's own domain), but I'm not able to display the logos for each domain.

Is it possible to get the domain logo in views?

2

I don't think you can do that with views only. You'll need to do some coding. The point is that your logos are not linked to your Domains, but to your themes.

So you need to get your theme based on the domain_id, and then print the logo of the theme.

[EDIT]

If you look at the api of theme_get_setting, then you can see that you can pass as a second parameter the name of the theme you want the logo. So it should be something like:

$MY_THEME_ID = domain_theme_lookup($MY_DOMAIN_ID);
$logo = theme_get_setting("logo", $MY_THEME_ID);
| improve this answer | |
  • Ok, I installed Views PHP modul and tried some coding. I tried theme_get_setting("logo") function but it returns logo of the active theme, not the logo of domain. Probably I need to run some code before this function? But I'm lost... – shacull Dec 26 '13 at 18:26
  • 1
    I edited my answer, take a look at it. – Matt Dec 27 '13 at 9:56
  • 1
    Thank you! It needed some more coding, because domain_theme_lookup returns array with domain settings, but I got it working: $theme = domain_theme_lookup($row->domain_id); $settings = unserialize($theme["settings"]); return file_create_url($settings["logo_path"]); – shacull Dec 27 '13 at 11:21
  • You guys should put the final code in one of your main posts. Maybe to Matts one, since he has pointed to the right direction? Great work by the way. :-) – nilsun Nov 16 '14 at 19:29
  • hell ... I should learn to read post dates ... :-/ sorry ... – nilsun Nov 16 '14 at 19:36

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.