Layout: what kind is active?

GK User
Thu Feb 09, 2012 2:38 pm
Hi,
in category blog page, i need to know what kind of layout is active (mobile or desktop) to view image in two different styles.
How can I find it?
User avatar
Senior Boarder

GK User
Thu Feb 09, 2012 3:02 pm
Hi,

If you use desktop to browse site, default layout is active, and if you use a handheld device then mobile layout is active.
User avatar
Platinum Boarder

GK User
Thu Feb 09, 2012 3:50 pm
Thank you Don Lee for your answer but i think that i didn't explain so well. I don't speak english very good.
It will be hard but i'll try to explain.
I have a photogallery in my site (you can see it here).
How you can see (in desktop layout) you have photogallery in right side page but in that article, there is an image too that has display property setted none.
I would have the follow configuration:
Mobile version: view image and don't view photogallery
Desktop version: don't view image and view photogallery.
So I have to know what layout is active before page shown. There is any session variable that contains that value?
Thank you
User avatar
Senior Boarder

GK User
Fri Feb 10, 2012 2:51 pm
I don't really understand you clearly, what I can understand is that you want to have different layouts for your Photo module when being viewed by desktop and mobile. If so I'm sorry that the feature is not available and if you really want to have it you would need to hire a developer to get this customization done for you.

Regards,
User avatar
Platinum Boarder

GK User
Fri Feb 10, 2012 3:23 pm
Thank you Don Lee, I know that isn't easy to understand me. I'll try another way.
Thank you so much.
User avatar
Senior Boarder

GK User
Mon Feb 13, 2012 4:59 pm
Sorry Don Lee but i have to try to solve my question.
Is it possible to show a message that informs user about platform that he's using?
for example:
<h1>You are using mobile platform</h1>
<h1>You are using desktop platform</h1>

Thank you so much
User avatar
Senior Boarder

GK User
Tue Feb 14, 2012 9:35 am
Yes, of course it's possible. Under folder \templates\gk_TPLNAME\layouts\ you will see some php files which generate layout for devices such as desktop (default.php), iPhone (iphone.php)... you can open them to add your html code, for example, in default.php add <h1>You are using desktop platform</h1>
User avatar
Platinum Boarder

GK User
Thu Feb 16, 2012 5:48 pm
This solution Don Lee isn't enough for my problem.
I try to explain you better.
In some article i have to show a photo gallery that i insert into an article by plugin.
In desktop layout this photogallery is:
{igallery id="6938" cid="12" pid="1" type="classic" children="1" showmenu="1" tags="" limit="0"}
in mobile version shoul be:
{igallery id="6938" cid="12" pid="2" type="classic" children="1" showmenu="1" tags="" limit="0"}

I thought to write new plugin and with a simple str_replace changing pid"1" in pid="2" but I don't know the way to detect layout version durin processing the page.

Can you help me please?
I think that there is the way but, If is necessary, I can pay for customization (if isn't too much expensive :D :D ).
Thank you so much
User avatar
Senior Boarder

GK User
Fri Feb 17, 2012 12:06 pm
Hi,

I understand your purpose now. We use an external library to detect device which you can use it as well for your plugin, you can find the file at templates\gk_blackandwhite\libs\mobile_device_detect.php, it will return you the device an user using to browse your site.

Feel free to let me know if you need any further helps!
User avatar
Platinum Boarder

GK User
Thu Mar 01, 2012 3:53 pm
Thank you so much! :)
User avatar
Senior Boarder

GK User
Fri Mar 02, 2012 12:37 pm
You are most welcome, feel free to let me know if you need any further help.

Cheers,
User avatar
Platinum Boarder


cron