ShopSite Mobile CGI javascript for custom template

Questions and answers about ShopSite Custom Templates

ShopSite Mobile CGI javascript for custom template

Postby hammer » Wed Feb 18, 2015 12:42 pm

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.
hammer
 
Posts: 127
Joined: Thu Mar 17, 2011 8:22 am

Re: ShopSite Mobile CGI javascript for custom template

Postby loren_d_c » Wed Feb 18, 2015 2:00 pm

Check out the Custom Template Cookbook page on this topic at:

http://www.shopsite.com/templates/cookbook/global-mobile-commerce.shtml
loren_d_c
 
Posts: 2569
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: ShopSite Mobile CGI javascript for custom template

Postby hammer » Mon Feb 23, 2015 10:23 am

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
hammer
 
Posts: 127
Joined: Thu Mar 17, 2011 8:22 am

Re: ShopSite Mobile CGI javascript for custom template

Postby hammer » Mon Feb 23, 2015 11:41 am

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?
hammer
 
Posts: 127
Joined: Thu Mar 17, 2011 8:22 am

Re: ShopSite Mobile CGI javascript for custom template

Postby Jim » Mon Feb 23, 2015 12:11 pm

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.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: ShopSite Mobile CGI javascript for custom template

Postby loren_d_c » Mon Feb 23, 2015 2:01 pm

Server Side Includes won't work on a page generated by a cgi file.

-Loren
loren_d_c
 
Posts: 2569
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: ShopSite Mobile CGI javascript for custom template

Postby hammer » Mon Feb 23, 2015 2:10 pm

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.
hammer
 
Posts: 127
Joined: Thu Mar 17, 2011 8:22 am

Re: ShopSite Mobile CGI javascript for custom template

Postby hammer » Mon Feb 23, 2015 2:43 pm

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.
hammer
 
Posts: 127
Joined: Thu Mar 17, 2011 8:22 am

Re: ShopSite Mobile CGI javascript for custom template

Postby loren_d_c » Mon Feb 23, 2015 5:20 pm

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
loren_d_c
 
Posts: 2569
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: ShopSite Mobile CGI javascript for custom template

Postby hammer » Wed Feb 25, 2015 10:49 am

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 :)
hammer
 
Posts: 127
Joined: Thu Mar 17, 2011 8:22 am

Re: ShopSite Mobile CGI javascript for custom template

Postby hammer » Wed Feb 25, 2015 1:00 pm

Thanks Loren, I got the PHP code to work on the static page.
hammer
 
Posts: 127
Joined: Thu Mar 17, 2011 8:22 am


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 18 guests

cron