CustomHTML Control Not Working
CustomHTML Control Not Working
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?
Re: CustomHTML Control Not Working
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.
Re: CustomHTML Control Not Working
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.
- ForumsAdmin
- AbleCommerce Moderator
- Posts: 399
- Joined: Wed Mar 13, 2013 7:19 am
Re: CustomHTML Control Not Working
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.
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.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: CustomHTML Control Not Working
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
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
- ForumsAdmin
- AbleCommerce Moderator
- Posts: 399
- Joined: Wed Mar 13, 2013 7:19 am
Re: CustomHTML Control Not Working
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.
Re: CustomHTML Control Not Working
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.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: CustomHTML Control Not Working
I did it by pulling the webpage id from a parameter and loading the 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
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
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
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