how can I restrict view of a specific content item/block to display only in a specific theme?

i'm using mobileplugin to manage the main website www.domain.com and wap website m.domain.com and the frontpage is a panel page. but i want to hide some of the content element in the panel when it's opened in the wap site (which is using mobile_garland theme).

can anyone help, please..
thanks

Comments

merlinofchaos’s picture

Status: Active » Fixed

Use the PHP Code selection rule.

  global $theme;

That will contain the name of the theme currently in use. Note that it's possible that a theme may not yet have been selected, in which case you might want to look at global $custom_theme to see if there is a theme waiting to be selected. If that is empty, it should be whatever the default theme is. Though I suppose global $user; $user->theme might also contain a potential theme.

toxiclung’s picture

Status: Fixed » Active

hi..
thanks for the reply.

i'm sorry if this is a stupid question, but i'm a drupal novice :)
since i only want to hide one content pane element, not the whole panel,
i assume i have to put "global $theme;" in:
edit panel>content>pane menu>visibility rules>add new rule>php code

but after i update and save the panel, the pane content became hidden
in both tapestry (default theme) and mobile_garland (wap theme).
i only wanted to hide it in mobile_garland.

i also tried "global $user; $user->theme;" but its the same.

regards,
tL

merlinofchaos’s picture

Status: Active » Fixed

Well, you have to do a comparison. If you need guidance on how to write basic PHP code to do that, you should try the forums, though; there are not enough resources in this queue to provide that here.

toxiclung’s picture

hi merlin..
thanks you. i'll try to figure out, now i know where to put the codes :D

cheers

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.