Author Topic: Multiple templates (based on browser)  (Read 17413 times)

0 Members and 1 Guest are viewing this topic.

Offline etherknight

  • Occasional poster
  • *
  • Posts: 23
    • View Profile
Multiple templates (based on browser)
« on: October 04, 2010, 02:24:03 AM »
Can one configure so as to present a particular templates based on the browser family? For example, one connects with an iPhone and they get the iPhone template. But another user connects with a traditional browser, and gets the typical template. Perhaps it could be done by running multiple instances of HFS, using two URLs? Like www.whatever.stuff & mobile.whatever.stuff for mobile browser families...

My apologies if this is one of the gazillion questions that have already been discussed (could not find the topic in search).

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Multiple templates (based on browser)
« Reply #1 on: October 10, 2010, 04:25:06 PM »
yes, it's possible.
i'll tell you more when i'm back home.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Multiple templates (based on browser)
« Reply #2 on: October 10, 2010, 09:31:05 PM »
there's no need for a different address.
probably the best solution is to ALT+F6 and paste something like this

[+request]
{.if|{.{.get|agent.} = iphone.}|{:
  {.load tpl|myOtherTemplate.tpl .}
:}.}

Offline etherknight

  • Occasional poster
  • *
  • Posts: 23
    • View Profile
Re: Multiple templates (based on browser)
« Reply #3 on: October 10, 2010, 10:54:47 PM »
Sweet. I will give it a try. I will let you know how it goes! Thanks :)

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Multiple templates (based on browser)
« Reply #4 on: October 11, 2010, 12:40:21 AM »
just a warning: the "load tpl" command won't run any installation on the template.
some templates may need to perform some actions at installation time, like rawr.

Offline Onoitsu2

  • Occasional poster
  • *
  • Posts: 1
    • View Profile
Re: Multiple templates (based on browser)
« Reply #5 on: February 09, 2011, 11:10:16 PM »
With regards to mobile devices, as far as blackberry devices, or at very least the BB Curve 9330 uploads fail quite often. Looks like
they simply timeout but once changed the default template upload link to load with the upload status pane have not had any uploads fail. And we are talking failures amounting to >75%. And now I can upload the entire listing with pics and vids. I use HFS for remote access of my files. No data plan so I am one that uses wifi and has every wifi work around imaginable. This failure was in the BB browser, Opera Mini 5.1.22303, as well as Bolt browser. I've set up MIME just right that I can stream mp3 and BB compatable videos, of which I have few.Absolutely LOVE!!! This software using 2.2f because it gets the job done for what I needed.

In fact this was posted from my BB in Bolt browser.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Multiple templates (based on browser)
« Reply #6 on: February 10, 2011, 10:49:23 PM »
good to hear it works for you.
what was discussed here before it's only related to version 2.3, anyway.

Offline stonecooper

  • Occasional poster
  • *
  • Posts: 8
    • View Profile
Re: Multiple templates (based on browser)
« Reply #7 on: August 13, 2011, 01:47:08 AM »
Could someone explain more detail. How do I know the agent = iphone? If I use a Andriod device, how to set it?

 {.load tpl|myOtherTemplate.tpl .}

Does the myOtherTemplate.tpl  can include the path? Like ./mytmp/myOtherTemplate.tpl?

I used my Andriod device to do the test, from the dump log:
User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; zh-cn; Desire_A8181 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

how to set this Marco?

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Multiple templates (based on browser)
« Reply #8 on: August 22, 2011, 03:53:16 PM »
the {.get|agent.} is a facility that currently doesn't support android.
anyway you can use something like
{.if|{.pos|android|{.header|User-Agent.}.}|{:
  {.load tpl|myOtherTemplate.tpl .}
:}.}


and yes, you can use a full path for the file

Offline BobS!nce1981

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
Re: Multiple templates (based on browser)
« Reply #9 on: September 05, 2011, 09:51:14 PM »
Help please. Do I need to include another string by chance? Its loading the .tpl as I have specified the full path, but the images and whatnot that go with the theme aren't showing up.

Thanks,

Bob

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Multiple templates (based on browser)
« Reply #10 on: September 17, 2011, 05:43:33 PM »
welcome and sorry for the late reply bob,
some templates need you to manually load them first, because this way the run some commands (a sort of installation procedure) like adding needed folders.

after that you should be ok.

Offline BobS!nce1981

  • Occasional poster
  • *
  • Posts: 2
    • View Profile
Re: Multiple templates (based on browser)
« Reply #11 on: September 19, 2011, 12:16:49 PM »
Ok.  Sorry to ask, but how do i do that?

Thanks.

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1890
    • View Profile
Re: Multiple templates (based on browser)
« Reply #12 on: September 19, 2011, 12:26:57 PM »
you can see inside the RAWR-Designs template: section SPECIAL IMPORT


Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Multiple templates (based on browser)
« Reply #13 on: October 04, 2011, 09:39:01 AM »
it's ok if you just drag&drop the .TPL file into HFS.
you will be prompted for installation.
This requires to be done just once (but you have to save the virtual file system afterward).

Offline MelkiyProd.

  • Occasional poster
  • *
  • Posts: 69
  • Languages: English, Русский, Українська.
    • View Profile
Re: Multiple templates (based on browser)
« Reply #14 on: March 31, 2012, 07:21:27 PM »
it's ok if you just drag&drop the .TPL file into HFS.
you will be prompted for installation.
This requires to be done just once (but you have to save the virtual file system afterward).

I can add to template - my mobile template and use his through android?
If i will open site through android, will used mobile template?