Page 1 of 1

ShopSite Mobile CGI javascript for custom template

PostPosted: Wed Feb 18, 2015 12:42 pm
by hammer
Hello

I am trying to implement the mobile feature in ShopSite 11sp2r5.

I am using custom templates for home page and product page and shopping cart. I am pretty sure I need to manually add the Shopsite Mobil Javascript to the custom template. Can you tell me where to get that ShopSite code? And where on the page it should go?

Thank you.

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Wed Feb 18, 2015 2:00 pm
by loren_d_c
Check out the Custom Template Cookbook page on this topic at:

http://www.shopsite.com/templates/cookbook/global-mobile-commerce.shtml

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Mon Feb 23, 2015 10:23 am
by hammer
Hello Loren,

Thank you so much for the link to the information on adding the javascript. So far it is working nicely.

I am not using Shopsite Navigaton in my custom templates, so the Mb_mobiledefault.sst is limiting me to only four menu items at the top of the page. What is the best way to add some additional links to our product pages and customer service page etc.

Would it involve includes? If so, how so.

I am running shopsite pro v11sp2r5.

Thank you,

Hammer

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Mon Feb 23, 2015 11:41 am
by hammer
Hi Loren,

Also, trying to use an include in the preferences > mobile > mobile footer

And I can't get the <!-- #include virtual="/includes/mobilefooter-inc.htm" --> to work. No data is being published. Is there something I am doing wrong with an include on a mobile site?

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Mon Feb 23, 2015 12:11 pm
by Jim
The mobile cgi which generates the page is not in the root of the domain so you may have to specify the full url for the include file.

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Mon Feb 23, 2015 2:01 pm
by loren_d_c
Server Side Includes won't work on a page generated by a cgi file.

-Loren

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Mon Feb 23, 2015 2:10 pm
by hammer
Hi again,

Per your suggestiong, I changed the virtural address to the full URL but the include is still not pulling in the code. I checked the source code for the mobile page after rendering and the include command is there rather than the code it is supposed to pull in. That is odd and suggests to me the include code is not being recognized or is not liking the file it is supposed to access. Does shopsite require a certain extension on include files for dynamic (cgi) pages? ie. html, htm, sst etc.???

I also tried putting the include file in the same directory -- changed virtual to file -- as the shopsite mobile template and it is still not being accessed.

I then put this test code in the footer, and it is also not being recognized by the cgi file either, although the command is showing up in the page source code.

<!--#config timefmt="%A" --> <!--#echo var="DATE_LOCAL" -->

What should I test next?

Thank you.

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Mon Feb 23, 2015 2:43 pm
by hammer
Loren ... got the message about no server side includes. I wonder if you can help me with how to add the mobile code to our static home page to take advantage of the mobile feature? If it can be done.

Our home page is a static page edited outside of shopsite. I am wondering if we can still use the Shopsite mobile scripts.

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Mon Feb 23, 2015 5:20 pm
by loren_d_c
ShopSite's 'Mobile' feature will only show mobile versions of ShopSite-generated pages, not any pages made outside of ShopSite. You could just add your own custom mobile detection JavaScript to your homepage, if you want, and redirect mobile browsers to one of the ShopSite-generated pages. Or create your page using Responsive design so that it automatically adjusts to the browser size and doesn't need to redirect.

-Loren

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Wed Feb 25, 2015 10:49 am
by hammer
Hi Loren,

Thank you again for the response.

For now I am just going to use a redirect on the static page to send a mobile device user to a shopsite generated page.

I have tried using some freeware server side PHP code without success. Can't get it to work.

I also tried some javescript code and can't get it to work. I tried it in several places on the HTML page and it still will not redirect an iphone.

Do you have a php file and script that you have used with success. Or perhaps a javascript that you have used with success?

Any help would be appreciated.

Thank you,

Hammer :)

Re: ShopSite Mobile CGI javascript for custom template

PostPosted: Wed Feb 25, 2015 1:00 pm
by hammer
Thanks Loren, I got the PHP code to work on the static page.