test
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • laurentmartin Friend
    #151269

    Hi,

    I saw on the demo version that on the bottom of the page there is a button for mobile version.

    How can it be implemented ? Is it a special URL to input or does it belong to a component ?

    Another question is , is there a way to implement a subdomain related to this mobile version.

    For example:

    Normal wrebsite http://www.mywebsite.com

    Mobile version: mobile.mywebsite.com

    Regards

    toymaker Friend
    #344396

    I have not tested this but it should work with no problem…

    T3 handles layouts in the way of a paramater thats thrown into the url.. like this:

    http://www.mywebsite.com/?main_layout=iphone

    This will switch your layout to the iphone version.
    You should be able to create an .htaccess rule that will convert
    http://iphone.mywebsite.com to -> http://www.mywebsite.com/?main_layout=iphone

    Doing this you wont be breaking any SEO components and its fairly simple. Some other kind of fix would probably involve using a Joomla extension… and will complicate things a little as you will be changing the base url.

    Hope it helps.

    Peace,
    Gabriel

    laurentmartin Friend
    #344398

    It changed the layout but do something very ugly not like in the demo.

    Are you sure about this instruction ?

    Regards

    toymaker Friend
    #344399

    Yes… 100% positive.
    I’ll look further into it tomorrow and post some code for you in case you dont get to make it work before i wake up 🙂

    Peace,
    Gabriel

    toymaker Friend
    #344468

    Ok… made a code and tested it on my site… so I know it works ok. 😉

    Open your .htaccess file and search the end of the Exploit rules block. After this block you will find the [ RewriteBase / ] rule. AFTER this rule, add the following block of code:

    ########### Your New custom rules

    RewriteCond %{HTTP_HOST} !^www.yoursite.com$ [NC]
    RewriteCond %{HTTP_HOST} ^(.+).yoursite.com [NC]
    RewriteRule ^(.*)$ http://www.yoursite.com/?main_layout=%1 [R,L]

    ########### Your New custom rules end

    This beautiful state of the art piece of code :laugh: will do a great little trick. It will take whatever you place as a subdomain EXCEPT “www” and pass it on as a layout parameter to your site. (You can add more exceptions just by copying the www exception and editing to suit your needs)

    So, if you use http://iphone.yoursite.com, this will get translated to use your iphone.php layout file.
    Same if you use http://handheld.yoursite.com or whatever you feel like using, including http://shop.yoursite.com

    OPTIONAL:
    You can change the last line of code to use a 301 redirect. This is probably useful for SEO voodoo

    RewriteRule ^(.*)$ http://www.yoursite.com/?main_layout=%1 [R=301,L]

    Hope it helps!

    Peace,
    Gabriel

    laurentmartin Friend
    #344485

    Hi,

    Thanks for your help regarding htaccess rewritting.

    The point is my website become when going to the iphone/handheld version i don’t know why.

    Gabriel, I send to you in private the URL if you have one minute to have a look of why it is doing an ugly paging.

    Regards

    toymaker Friend
    #344488

    Hi!
    Ok.. I see…
    It really depends on how you have modified your template. Your iphone layout should be like this
    http://templates.joomlart.com/ja_kyanite_ii/?main_layout=iphone

    As you can see, you must have made changes in a way that you broke stuff which is kind of difficult to fix. Fixing your template would consider making everything again, or at least most of it.

    You do have an alternative though… you can change the default css file to the original one only for the iphone layout.
    Step 1: get the original template.css file from the original template
    Step 2: Rename the template.css file to template_iphone.css
    Step 3: go to Blocks folder and copy head.php to head_iphone.php
    Step 4: open head_iphone.php file and where it references template.css change to template_iphone.css
    Step 5:Go back and open iphone.php on the layouts folder. Change the reference from head block to head_iphone block

    With this you will be using the original css file only for your iphone layout. This should fix it.

    Peace,
    Gabriel

    laurentmartin Friend
    #344555

    Hi Gabriel,

    I will make a try and come back to you to let you know the result.

    Regards

Viewing 8 posts - 1 through 8 (of 8 total)

This topic contains 8 replies, has 2 voices, and was last updated by  laurentmartin 14 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum