CustomHTML Control Not Working

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
VIPER7
Captain (CAPT)
Captain (CAPT)
Posts: 247
Joined: Fri Apr 15, 2005 2:49 pm

CustomHTML Control Not Working

Post by VIPER7 » Wed May 21, 2014 9:14 am

I am trying to modify one of my Layout templates and add a CustomHTML module to the left sidebar but when I add the CustomHTML control, it does not give me the ability to add / edit my "custom HTML". How can I make this work?

nadeem
Captain (CAPT)
Captain (CAPT)
Posts: 258
Joined: Tue Jul 31, 2012 7:23 pm

Re: CustomHTML Control Not Working

Post by nadeem » Wed May 21, 2014 11:53 pm

To add custom HTML, you have to open WebSite/Conlib/CustomHTML.ascx in some editor of your choice and add your desired HTML. If you add some parameters in code behind, edit link will show at edit layout page that will give you the ability to edit parameters.

VIPER7
Captain (CAPT)
Captain (CAPT)
Posts: 247
Joined: Fri Apr 15, 2005 2:49 pm

Re: CustomHTML Control Not Working

Post by VIPER7 » Thu May 22, 2014 7:34 am

People should not have to be going into any .ascx files and adding any code to the files. That's the point of the admin front end, isn't it? I completely agree with hello_kitty. This is NOT a practical solution at all! It seems Able has unfortunately taken a few steps back in some areas where the Gold release is concerned. This is still a software for the technically proficient, which there are much fewer of on this planet than not.

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: CustomHTML Control Not Working

Post by ForumsAdmin » Fri May 23, 2014 12:30 am

The background and purpose of the control named CustomHTML can be understood by having a look at this old forum post.
viewtopic.php?f=65&t=17437&p=74773&

You can see that the purpose of control named 'CustomHTML' was to provide a sample control that users can make copies of, add custom HTML to, and use it where they like. On feedback from customers this control was made part of AC GOLD.

The way you want this control to work is different. You want a single control that is used in different places. You want to provide the HTML to it as a parameter. How much of custom HTML can be provided in a simple string parameter? If we were to take the custom HTML as a configurable parameter in admin we would severely limit the use of this control.

There are other ways to handle this though. But I would suggest that you take the most straightforward approach. Just make a copy of CustomHTML control. Name it as per your needs. Add static html in it. Make use of it anywhere you like.

If you want a general purpose control, to which you can provide custom HTML as configuration value, the above control is not suitable, you can add a feature request via Uservoice and vote for this feature. We will find a way of implementing this without having to provide HTML as a control parameter.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: CustomHTML Control Not Working

Post by jmestep » Fri May 23, 2014 4:00 am

I have made a control for clients that pulls the content of a private webpage into it. They create a private webpage, put the html in, pass the webpageid as a parameter to the control and can put the control anywhere. That way clients who don't know about ftp can add custom content into the admin and have the advantage of the WYSIWYG editor. I had done this in Able 7 also because it was quite cumbersome in 7 to add content to scriplets and use the scriplet somewhere.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: CustomHTML Control Not Working

Post by ForumsAdmin » Sat May 24, 2014 3:41 am

Making use of a webpage object is a good idea. The id of the webpage is a good parameter to pass to the control. We will add this feature to the CutomHTML control.

VIPER7
Captain (CAPT)
Captain (CAPT)
Posts: 247
Joined: Fri Apr 15, 2005 2:49 pm

Re: CustomHTML Control Not Working

Post by VIPER7 » Fri May 30, 2014 10:54 am

What all this in mind, how would I go about adding a 2nd customHTML control to my site? I have two separate areas on my site that need completely different custom content added.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: CustomHTML Control Not Working

Post by jmestep » Mon Jun 02, 2014 4:30 am

I did it by pulling the webpage id from a parameter and loading the content

Code: Select all

private int _WebpageId = 0;
        [Personalizable(), WebBrowsable()]
        [Browsable(true), DefaultValue("0")]
        [Description("The webpage id from which you pull the content")]
        public int WebpageId
        {
            get { return _WebpageId; }
            set { _WebpageId = value; }
        }

Code: Select all

... load content
I also made it inherit from the ISidebarControl so it would show up in the admin to add to a sidebar in case the merchant wanted to add it to a sidebar.

public partial class WebpageContent : System.Web.UI.UserControl, ISidebarControl
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply