-
AuthorPosts
-
May 23, 2010 at 4:47 am #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 Friendtoymaker
- Join date:
- April 2010
- Posts:
- 123
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 10
- Thanked:
- 45 times in 32 posts
May 23, 2010 at 5:07 am #344396I 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,
GabrielMay 23, 2010 at 5:45 am #344398It changed the layout but do something very ugly not like in the demo.
Are you sure about this instruction ?
Regards
toymaker Friendtoymaker
- Join date:
- April 2010
- Posts:
- 123
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 10
- Thanked:
- 45 times in 32 posts
May 23, 2010 at 6:08 am #344399Yes… 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,
Gabrieltoymaker Friendtoymaker
- Join date:
- April 2010
- Posts:
- 123
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 10
- Thanked:
- 45 times in 32 posts
May 23, 2010 at 11:33 pm #344468Ok… 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.comOPTIONAL:
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,
GabrielMay 24, 2010 at 3:07 am #344485Hi,
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 Friendtoymaker
- Join date:
- April 2010
- Posts:
- 123
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 10
- Thanked:
- 45 times in 32 posts
May 24, 2010 at 3:39 am #344488Hi!
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=iphoneAs 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 blockWith this you will be using the original css file only for your iphone layout. This should fix it.
Peace,
GabrielMay 24, 2010 at 2:56 pm #344555Hi Gabriel,
I will make a try and come back to you to let you know the result.
Regards
-
AuthorPosts
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