Image alt text

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 14 años
Is there a way to change the alt text in the product picture thumbnails? It says "product image" on every image.
Hace 14 años
Hi,

You could do this, Goto modules/ProductInfo.ascx

locate and change

<img src="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"), 70)%>" alt="Product image" />

to

<img src="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"), 70)%>" alt="<%= lProductName.Text%>" />

This will set the alt text to the title of you product.

hope this helps..

mike..
Hace 14 años
Thank you. Your information worked great.

Do you have any idea how I could implement some text under the multiple images indicating to click on the images to enlarge?  Here is what I tried but I got build errors.

ProductInfo.ascx...
        <asp:ListView ID="lvProductPictures" runat="server" GroupItemCount="3" >
            <LayoutTemplate>
                <table>
                    <asp:PlaceHolder runat="server" ID="groupPlaceHolder"></asp:PlaceHolder>
                </table>
                        <div id="clickhere"style="color: #FFF;
                             background-color: #3A3A3A;
                             border: 1px solid #FF9900;
                             padding-top: 2px;
                             padding-bottom: 2px;
                             text-align: center;
                             font-size: 9px">
                             <i>Click Image To View Lightbox</i>
                         </div>
            </LayoutTemplate>
            <GroupTemplate>
                <tr>
                    <asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
                </tr>
            </GroupTemplate>
            <ItemTemplate>
                <td align="left">
                    <a href="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"))%>" rel="lightbox-p"
                        title="<%= lProductName.Text%>">
                        <img src="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"), 70)%>" alt="<%= lProductName.Text%>" />
                </td>
            </ItemTemplate>
            
        </asp:ListView>
Hace 14 años
Hi Cboy,

What you need todo is move your Click to enlareg div to here:

ProductInfo.ascx...
        <asp:ListView ID="lvProductPictures" runat="server" GroupItemCount="3" >
            <LayoutTemplate>
                <table>
                    <asp:PlaceHolder runat="server" ID="groupPlaceHolder"></asp:PlaceHolder>
                </table>
            </LayoutTemplate>
            <GroupTemplate>
                <tr>
                    <asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
                </tr>
            </GroupTemplate>
            <ItemTemplate>
                <td align="left">
                    <a href="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"))%>" rel="lightbox-p"
                        title="<%= lProductName.Text%>">
                        <img src="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"), 70)%>" alt="<%= lProductName.Text%>" />
                    <div id="clickhere"style="color: #FFF;
                             background-color: #3A3A3A;
                             border: 1px solid #FF9900;
                             padding-top: 2px;
                             padding-bottom: 2px;
                             text-align: center;
                             font-size: 9px">
                             <i>Click Image To View Lightbox</i>
                         </div>

                </td>
            </ItemTemplate>
            
        </asp:ListView>

This will diplay text under each image :-)

mike..
Hace 14 años
Hi Mike,

Does this solution work for you?  The reason I ask is because I keep getting build errors.  I also get build errors with <img src="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"), 70)%>" alt="<%= lProductName.Text%>" />.

Chad
Hace 14 años
Hi Chad,

Just tested and works fine.. Could you post your error message?

mike..
Hace 14 años
Thank you for your reply,

This is a fresh install of v1.40 on my local machine.  I kept the changes very simple to see where the instance is showing up.  The only line changed in the whole site is  "<img src="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"), 70)%>" alt="Click To View Image" /></a>".  The only time the error shows up in the log is after the lightbox thumbnails have been clicked.  Here is the details of the error;

System.Web.HttpException: The file '/NopComm1.40/Products/default.aspx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Thank you,
Chad
Hace 14 años
Anybody???
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.