Page 1 of 1
Adding popup html information to the product description.
Posted: Tue Jul 21, 2009 7:11 am
by ZLA
For some of our products, we want users to be able to click on a link in the product description and pop up a browser window that displays an html file. To do this, I'm not quite sure about the following:
1. How would an admin upload and manage these html files?
- Can I use Images and Assets for this even though they aren't image files?
- It almost looks like I could use the scriptlet manager to manage the html files? Is that a good idea?
2. Rather than putting a long window.open(...) javascript statement into the description, I'd rather create a javascript function and just call something like popupProductHTML('SomeFile.htm') and define and reference popupProductHTML in an external javascript file. How can I insert the external file <SCRIPT LANGUAGE="JavaScript" SRC="myscript.js" /> line for each page?
- Do I just need to add it to the \layouts\*.master pages?
- Where is the "best" location for the external file? I'm thinking somewhere in App_Data.
Thanks in advance.
Re: Adding popup html information to the product description.
Posted: Tue Jul 21, 2009 7:53 am
by mazhar
1. How would an admin upload and manage these html files?
- Can I use Images and Assets for this even though they aren't image files?
- It almost looks like I could use the scriptlet manager to manage the html files? Is that a good idea?
What about using AbleCommerce webpage feature for this functionality. With this approach he can manage his/her html via admin tool.
Code: Select all
2. Rather than putting a long window.open(...) javascript statement into the description, I'd rather create a javascript function and just call something like popupProductHTML('SomeFile.htm') and define and reference popupProductHTML in an external javascript file. How can I insert the external file <SCRIPT LANGUAGE="JavaScript" SRC="myscript.js" /> line for each page?
- Do I just need to add it to the \layouts\*.master pages?
- Where is the "best" location for the external file? I'm thinking somewhere in App_Data.
Create your file under
website/js folder and then put your
Code: Select all
<script src="~/js/yourscript.js"></script>
statement in the content section of website header, in this way it will be available through out the website and there will be no code change as well.
Re: Adding popup html information to the product description.
Posted: Tue Jul 21, 2009 7:55 am
by mazhar
Regarding popup read following thread
viewtopic.php?f=47&t=9983
Greybox can load new pages in popup window in a fancy way.
Re: Adding popup html information to the product description.
Posted: Tue Jul 21, 2009 9:36 am
by ZLA
mazhar wrote:
What about using AbleCommerce webpage feature for this functionality. With this approach he can manage his/her html via admin tool.
When I looked at the help, it seems like webpages are linked to categories which isn't really what I want. However, I just realized how to use the Asset Manager from the main menu rather than from a particular product's images. It seems like it will work just fine if I add an extra subfolder called HTML.
Can you direct me to info about using webpages as you suggested so I can compare and determine which is easier? Also, where do webpages get located once uploaded?
mazhar wrote:
Create your file under
website/js folder and then put your
Code: Select all
<script src="~/js/yourscript.js"></script>
statement in the content section of website header, in this way it will be available through out the website and there will be no code change as well.
Doesn't it really belong in the <HEAD> section of the page? Standard Header.htm is just part of the page's <BODY> section.
I realize this will work but does it really belong in the .master files or would that cause problems?
I'm sure GreyBox would be a slicker solution but it's more than I need (or have agreed to in my project scope) so that will have to wait for now.
Re: Adding popup html information to the product description.
Posted: Tue Jul 21, 2009 9:59 am
by mazhar
Can you direct me to info about using webpages as you suggested so I can compare and determine which is easier? Also, where do webpages get located once uploaded?
Webpage contents are stored in database. Yes they must be created under some category but you can change the visibility of that category to hidden. In this way customer wont see it on store side and at the same same time your direct page links will work as well so you can point your popup window to those links. You can remove the bread crumbs control from web page display scriptlet to hide category information. Currently Webpage documentation part is missing on help site, but you will find many post discussing webpage usage in forums. So you can ran query across forums for webpage discussion.
I realize this will work but does it really belong in the .master files or would that cause problems?
If you put the script statement in the head section of the Header scriptlet it will be rendered between HTML head tag where it should be.
Re: Adding popup html information to the product description.
Posted: Tue Jul 21, 2009 10:01 am
by jmestep
The webpages are adding in any category in the admin, like you would a category or product. Then you can make them hidden if you don't want them to show up in the site navigation. By doing it using that feature, you have an easy way to edit the contents of a page, rather than having to edit the html thru ftp or something.
Re: Adding popup html information to the product description.
Posted: Tue Jul 21, 2009 10:46 am
by ZLA
mazhar wrote:If you put the script statement in the head section of the Header scriptlet it will be rendered between HTML head tag where it should be.
I don't see a HEAD section in either the customized or default scriptlets. For example, Standard Header.htm shows:
Code: Select all
<!--
<Description>
Displays the standard store header.
</Description>
-->
<table id="storeHeader" cellpadding="0" cellspacing="0">
<tr>
<td class="logo">
<a href="~/Default.aspx">[[ConLib:StoreLogo]]</a>
</td>
<td class="headerContent" align="right" valign="top">
<div class="shortcuts">
#if($customer.IsAnonymous)
<a href="~/Login.aspx" class="login">Login</a>
#else
<a href="~/Logout.aspx" class="login">Logout</a>
#end
<a href="~/Members/MyAccount.aspx" class="acct">Account</a>
<a href="~/Members/MyWishlist.aspx" class="wishlist">Wishlist</a>
<a href="~/Basket.aspx" class="basket">Cart</a>
#if($customer.IsAdmin)
<a href="~/Admin/Default.aspx" class="admin">Admin</a>
#end
</div>
<div class="search">
[[ConLib:SimpleSearch]]
</div>
</td>
</tr>
<tr>
<td class="navigation" colspan="2">
<div class="content" style="float:left;">
<a href="~/Default.aspx" class="tab">Home</a>
<a href="~/Search.aspx" class="tab">Product Finder</a>
<a href="~/AdvancedSearch.aspx" class="tab">Advanced Search</a>
#if ($store.Currencies.Count > 1 )
<a href="~/Currencies.aspx" class="tab">Currencies</a>
#end
<a href="~/ContactUs.aspx" class="tab">Contact Us</a>
</div>
</td>
</tr>
</table>
while Three Column.htm shows:
Code: Select all
<!--
<Description>
Displays headers, footers, a left sidebar, a right sidebar, and a main content area.
</Description>
-->
[[layout:header]]
<div id="outerContentWrapper">
<div id="innerContentWrapper">
<table cellspacing="0" cellpadding="0" id="contentLayout">
<tr>
<td align="left" valign="top" id="leftSidebarPanel">
[[layout:leftsidebar]]
</td>
<td align="left" valign="top" id="mainPanel">
[[layout:content]]
</td>
<td align="left" valign="top" id="rightSidebarPanel">
[[layout:rightsidebar]]
</td>
</tr>
</table>
</div>
[[layout:footer]]
</div>
I don't see any content scriptlets that contain <HEAD> sections. When I searched on <HEAD> and <HEAD >, these are the only non-Admin, non-Install files that match:
- \Errors\GeneralError.aspx
- \Errors\PageNotFound.aspx
- \Layouts\LeftSidebar.master
- \Layouts\OneColumn.master
- \Layouts\Printable.master
- \Layouts\RightSidebar.master
- \Layouts\Scriptlet.master
- \Layouts\ThreeColumn.master
- \ProductImages.aspx
What obvious thing am I not seeing?
Re: Adding popup html information to the product description.
Posted: Wed Jul 22, 2009 1:43 am
by mazhar
I am taking about the header section, please have a look at snap below
Re: Adding popup html information to the product description.
Posted: Wed Jul 22, 2009 5:52 am
by ZLA
Thanks Mazhar. I told you it was an obvious thing I was missing. I'm so used to editing the scriptlets from Visual Studio, I've overlooked the standard way.