Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-01-23 15:51:19

WebKat
Member
Registered: 2007-01-16
Posts: 301

Mobile site: new install, sharing a db? same install; different pages?

Due to the nature of my website, simply making a mobile version in css will not work adequately.

Option 1) What I’d like to do is have a subdomain (m.mysite.com) and install a second copy of textpattern there, but point it at the same database, and then make different page and form and style templates and use those…

…will this work? I mean if it’s the same database I’m worried that the changes would go across both domains… Can someone advise?

Option 2) Alternately is there a way to make the page detect if it’s a mobile device and show the content using a different page template? That actually might be preferable to the second install method I just can’t think of a way to do it.

I’d like to avoid the whole if/else thing where you have one mammoth page with both options on it that get pulled depending on what the browser is… because doesn’t it all load somehow? I mean I know that css-hidden images still load on mobile browsers and add to the page size and download time…

If you can’t tell I don’t know much about this particular area of web design so I’m anxious for any tips you can give me.



WebKat

Offline

#2 2012-01-23 15:54:47

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: Mobile site: new install, sharing a db? same install; different pages?

(Btw, I’m also posting in a similar thread here)



WebKat

Offline

#3 2012-01-23 16:58:39

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

Re: Mobile site: new install, sharing a db? same install; different pages?

I’m answering your question from here

I guess it depends what url schema you use for navigation. Do you use sections or categories? is your menu populated by sections or categories?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2012-01-23 17:10:46

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Mobile site: new install, sharing a db? same install; different pages?

I think that txp:adi_mobile can do option 2 and save you a lot of grief.

Offline

#5 2012-01-23 17:29:12

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: Mobile site: new install, sharing a db? same install; different pages?

colak wrote:

I’m answering your question from here

I guess it depends what url schema you use for navigation. Do you use sections or categories? is your menu populated by sections or categories?

My menu is categories…



WebKat

Offline

#6 2012-01-23 18:17:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

Re: Mobile site: new install, sharing a db? same install; different pages?

WebKat wrote:

My menu is categories…

I have an idea for you but I need another 2 questions answered.

do you have lots of templates or just one?

If you have more than one how many sections and how many templates?

Last edited by colak (2012-01-23 18:21:23)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2012-01-23 18:22:47

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: Mobile site: new install, sharing a db? same install; different pages?

9 page templates
25 sections



WebKat

Offline

#8 2012-01-23 18:33:57

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

Re: Mobile site: new install, sharing a db? same install; different pages?

oops that’s a lot !!!

anyway my idea would be very easy if you only had a couple of templates but it can still be done with your setup

any mobile detection plugin would do but for this explanation i’ll be using act_if_mobile

If you added something like the code below on the top of your templates

<txp:act_if_mobile>
<txp:output_form form="mobile" /> <!-- this is where the mobile template resides, html, head body,everything -->
<txp:else />
<!-- this is your current template -->
</txp:act_if_mobile>

if you want different mobile layouts just use different forms on a per template scenario.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2012-01-23 18:48:39

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

Re: Mobile site: new install, sharing a db? same install; different pages?

Also if you want to dive into the mobile devices abyss maybe the resolutions of 4,684 different machines listed here might be of help.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#10 2012-01-23 19:31:58

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: Mobile site: new install, sharing a db? same install; different pages?

colak wrote:

oops that’s a lot !!!

anyway my idea would be very easy if you only had a couple of templates but it can still be done with your setup

any mobile detection plugin would do but for this explanation i’ll be using act_if_mobile

If you added something like the code below on the top of your templates

<txp:act_if_mobile>
<txp:output_form form="mobile" /> <!-- this is where the mobile template resides, html, head body,everything -->
<txp:else />
<!-- this is your current template -->
</txp:act_if_mobile>
if you want different mobile layouts just use different forms on a per template scenario.

So basically each of my templates would be a double template?

Last edited by WebKat (2012-01-23 19:32:14)



WebKat

Offline

#11 2012-01-23 19:51:22

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

Re: Mobile site: new install, sharing a db? same install; different pages?

WebKat wrote:

So basically each of my templates would be a double template?

the way it works above… yes:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#12 2012-01-23 22:00:39

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: Mobile site: new install, sharing a db? same install; different pages?

Would the other template load at all? (like if you looked at the source code, would you see it?)



WebKat

Offline

Board footer

Powered by FluxBB