Recent Topics

[2.4.x] Skin switching for mobile device users?

Started by on Mar 19, 2008 – Contents updated: Mar 19, 2008

Mar 19, 2008 15:24    

My b2evolution Version: 2.4.x

I'd like mobile device users to be able to use a simplified skin optimised for a small screen. I know user skin switching has been disabled in 2.x, but I also know I can display a page in a different skin by adding /?tempskin=custom to the end of the URL.

If I redirected the URL www.myblog.com/mobile to www.myblog.com/?tempskin=custom then users would see the mobile skin. Of course as soon as they followed a link, such as to the next post, it would switch back to the standard skin.

What I want to know is, is there a way to modify the custom skin so it automatically adds the string /?tempskin=custom to the end of all the URLs on the page? Or is there a way I can edit lines of code like;


$Item->permanent_link( array(
		'class' => 'permalink_right',
	) );

so as to add /?tempskin=custom into the generated URL? It would be a very simple skin, so I'd be happy to manually edit each such link (ie comments, permalink, next post).

Any suggestions would be greatly appreciated.

Mar 20, 2008 04:05

What if I installed another copy of b2evolution at www.myblog.com/mobile and used the same _basic_config.php file as the main site?

Is this bad for the database? Am I crossing the streams, as the Ghostbusters would say?

I tried it on my test site and it seemed to work, except when I went into the admin for www.myblog.com/mobile and changed the skin from evopress to custom it also changed the skin on www.myblog.com. My guess is the skin choice data must be kept in the database, so it's applied to both blogs. Is there away around this, so the two blogs could read from the same database but use different skins? Could I change the base URL in the evopress template on www.myblog.com/mobile so it pointed to the custom template, or something like that?

Of course there's still the ?tempskin=custom trick, if someone knows how to get that to work.

Once again, any suggestions would be greatly appreciated. I'm sure there must be a way to do this.

Mar 20, 2008 05:21

okay, I made some progress by harding coding the base URL in the evopress template on www.myblog.com/mobile so it points to www.myblog.com/mobile/skins/evopress

Now I can modify the evopress skin in the /mobile blog to make it mobile-friendly without affecting the main site, coz as far as they're concerned they're both using the same skin.

Of course now I've hit the links problem again. Links generated on each page in www.myblog.com/mobile still point to to www.myblog.com pages. I think this should be easier to fix than the ?tempskin=custom hack, because I only need to change the base URL for all the links on the page.

Can someone tell me where I can dip into the b2evolution code (2.4.1) and change the base URL for links on a page? It has to be done in the code, coz if I do it in the web interface (and thus the database) then it will affect the main site as well.

Jun 23, 2008 19:08

Resurrecting the dead here as I continue to search the forums...

Anyone had success in doing this? I'd also like to have one database, and feed the content to a mobile.myb2site.com subdomain that would use a stripped down 'Custom' or 'Basic' skin.

Feel free to point me to the appropriate topic if there has been a solution posted.


Form is loading...

Content Mangement System – This forum is powered by b2evolution CMS, a complete engine for your website.