if statement based on theme in use

Permalink
Hi all,

I am developing a C5 website with screen and mobile templates (using jquery mobile) and was wondering if there is a way of using an if statement inside a blocks view file selecting content based on the theme in use?

More detail:
I am using Area Splitter's accordion feature which works great on screen but the jquery mobile accordion looks better when on mobile so I am trying to edit the Area Splitters view file to render one layout if it is using my screen template and a different layout if using my mobile template.

Near as I can tell an if statement within the view file is the best approach however I have no idea where to begin.

Any help would be hugely appreciated.

 
fosterphillips replied on at Permalink Reply
Any luck on this? Trying to get a conditional statement based on which theme is being used, just as you described.

Thanks.
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
You will probably want to expand on this with checks for object validity.

$page = Page::getByID($cID);
$theme_obj = $page->getCollectionThemeObject();
$theme_handle = $theme_obj->getThemeHandle();