PDA

View Full Version : style chooser missing in mobile theme


Chadi
03-29-2013, 08:30 PM
I have enabled allow user to change styles in vb options, but when visiting my site via mobile, it does not show the drop down style chooser. There are 10 color variation styles I'm using. They have to click full site link to go back and choose the different mobile skin option.

How can I add this in the footer area?

I tried adding below in footer before last </div> doesn't work

<vb:if condition="$show['quickchooser']">
<select name="styleid" onchange="switch_id(this, 'style')">
<optgroup label="{vb:rawphrase quick_style_chooser}">
{vb:raw quickchooserbits}
</optgroup>
</select>
</vb:if>

kNeo
03-29-2013, 11:00 PM
EDIT: This doesn't work all the way, the "onchange" event doesn't fire correctly. Sorry about that. I think it needs some bit of the desktop javascript... hmm

Since this bit of code uses a form, you need to include the entire section (although you can leave out the language bit if you want)

This is what it looks like in a default theme:

<form action="{vb:link forumhome|nosession}" method="get" id="footer_select" class="footer_select">

<vb:if condition="$show['quickchooser']">
<select name="styleid" onchange="switch_id(this, 'style')">
<optgroup label="{vb:rawphrase quick_style_chooser}"><option class="hidden"></option></optgroup>
<vb:if condition="$quickchooserbits1">
<vb:if condition="$quickchooserbits2">
<optgroup label="&nbsp;{vb:rawphrase standard_styles}">
</vb:if>
{vb:raw quickchooserbits1}
<vb:if condition="$quickchooserbits2">
</optgroup>
</vb:if>
</vb:if>
<vb:if condition="$quickchooserbits2">
<vb:if condition="$quickchooserbits1">
<optgroup label="&nbsp;{vb:rawphrase mobile_styles}">
</vb:if>
{vb:raw quickchooserbits2}
<vb:if condition="$quickchooserbits1">
</optgroup>
</vb:if>
</vb:if>
</select>
</vb:if>

<vb:if condition="$show['languagechooser']">
<select name="langid" onchange="switch_id(this, 'lang')">
<optgroup label="{vb:rawphrase quick_language_chooser}">
{vb:raw languagechooserbits}
</optgroup>
</select>
</vb:if>
</form>

If you take that and stick it in the the footer templates for each mobile style right before the last </div> your mobile users should see the style chooser; I just tested it on my dev board and the default mobile style but just a disclaimer: I don't know if it will work for your mobile themes.

g'luck.

Chadi
03-30-2013, 05:58 AM
Thanks. Anyone else know?

Zachery
03-30-2013, 06:59 AM
The stylechooser has never been available in the vBulletin mobile style. There should be a full style link.

Chadi
03-30-2013, 04:56 PM
Yes the full site link is there, but I have 10 color options in mobile theme. It would be nice to add the style chooser, OR even direct links if possible.

--------------- Added 1364662628 at 1364662628 ---------------

Another question, how can I add total users online in mobile theme?

I tried this code,

<span style="float:right">{vb:rawphrase x_members_and_y_guests}</span>

But it came back this way

%1$s members and %2$s guests

Thanks :)

kNeo
03-30-2013, 10:27 PM
You can just make actual links, ?styleid=X

and just repeat until you've got a link for each mobile style version and then just stick it in the footer template for the mobile styles.

basically: vB can't do it automatically, but you can still hardcode it.

eg:


<ul>
<li><a href="?styleid=XX">Xxxxx</a>
<li><a href="?styleid=XX">Xxxxx</a>
<li><a href="?styleid=XX">Xxxxx</a>
</ul>


or whatever

Chadi
03-30-2013, 11:01 PM
Thanks I have done that earlier and opened a new thread

https://vborg.vbsupport.ru/showthread.php?t=296676

Can't figure out how to center align :x