rejetto forum

Multiple templates (based on browser)

0 Members and 2 Guests are viewing this topic.

Offline etherknight

  • Occasional poster
  • *
    • Posts: 23
    • View Profile
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: 13523
    • View Profile
yes, it's possible.
i'll tell you more when i'm back home.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
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
Sweet. I will give it a try. I will let you know how it goes! Thanks :)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
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
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: 13523
    • View Profile
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
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: 13523
    • View Profile
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
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: 13523
    • View Profile
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

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2063
    • View Profile
you can see inside the RAWR-Designs template: section SPECIAL IMPORT



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
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: 70
  • Languages: English, Русский, Українська.
    • View Profile
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?