PDA

View Full Version : Package a mobile template into a custom product?


DetroitYES
03-27-2012, 06:41 PM
I want the custom page that my product uses ( DIR /atdasd.php) to have its own mobile template as well as its default full screen display. Much the way showthread or any of the templates work in mobile.

I know that I could go into the mobile style, and reconfigure the template manually, but is there anyway to package this with the install?

The most user friendly method i have come up with is to include the mobile template in the master style and then instruct users to copy this code, and paste it into the appropriate template on the mobile style...

Is there a more streamlined way of including this? Thanks.


Edit... I've figured out how to hack this into the actual script using the 'bb_skipmobilestyle' cookie. It is not as pretty as having the mobile template stored in the mobile style, but is more user friendly...



// pre-cache templates used by all actions
if ($_COOKIE['bb_skipmobilestyle'] == 0)
{
$globaltemplates = array(
'ad_board_after_forums',
'ad_board_below_whats_going_on',
'block_html',
'atdasd_mobile',
);
}
else
{
$globaltemplates = array(
'ad_board_after_forums',
'ad_board_below_whats_going_on',
'block_html',
'ATDASD',
);
}


And a further question, can anyone explain to me why the above code works, but this will not? Am I somehow breaking the array syntax?


if ($_COOKIE['bb_skipmobilestyle'] == 0)
{
$atdasd_product_template = 'atdasd_mobile';
}
else
{
$atdasd_product_template = 'ATDASD';
}
$globaltemplates = array(
'ad_board_after_forums',
'ad_board_below_whats_going_on',
'block_html',
$atdasd_product_template,
);

Paul M
03-28-2012, 06:39 PM
Not exactly sure what you mean here, but you include mobile [master] templates in a product like this ;

<templates_mobile>
<template name="Mobile_test" templatetype="template" date="1332963439" username="Admin" version="1.0.0"><![CDATA[xxxxxxxxxxxxxxxxxxxxxxxx]]></template>
</templates_mobile>

DetroitYES
03-29-2012, 05:57 PM
I'm not sure i did this correctly, will this allow me to make a template with the same name in the mobile skin?

The main template I use is ATDASD, I have that functioning and it installs correclty for the full screen via the xml. Then I added this to the xml (creating a template with the mobile syntax using the same name as the full screen template)... with hopes of overriding the code in the template for the mobile skin... I would like the page using the ATDASD template to automatically use the mobile version of the the template when the user is in the mobile skin...


<templates_mobile>
<template name="ATDASD" templatetype="template" date="1332862291" username="Traxus" version="1.0.0"><![CDATA[xxxxxx]]></template>
</templates_mobile>


is that correct? If so, it may be a vbulletin version issue, I'm testing on v 4.1.8...

--------------- Added 1333053114 at 1333053114 ---------------

Okay, I upgraded to 4.1.11 and this worked fine now that they separate skins into mobile and full screen.

thanks