Overiding with the ConLib Custom folder doesn't seem to work

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
europhile
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Fri Jan 23, 2009 3:05 am

Overiding with the ConLib Custom folder doesn't seem to work

Post by europhile » Tue Feb 10, 2009 7:34 am

There's some good posts about customising pages but I'm having a problem with one assumption - the ConLib\Custom allows new .ascx controls (and their .cs) so they can be referenced fine as [[ConLib:Custom\<filename>]]. This is similar to the Scriplets method.

However, like the Scriptlets, it is anticipated that .ascx files in the ConLib\Custom with the same name as the original one in the base folder will over-ride the original. Eg. a copy of MiniBasket.ascx (with same name) can be modified in the Custom folder so that it doesn't show the Shipping Estimator (visible="false"). Unfortunately, it doesn't seem to kick in, the original with Shipping Estimator still shows! If I make the same change in the original base file, naturally it works and the Estimator doesn't show - great. But I thought that Custom controls with same name will override, which makes backup and future updates much easier.

I tried reloading/recycling the app, stop/start, but no joy. Am I missing something or does this override behaviour not work on ConLib unlike Scriptlets?

Phil

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

Re: Overiding with the ConLib Custom folder doesn't seem to work

Post by jmestep » Tue Feb 10, 2009 7:49 am

You need to change the code within the files that are used in the Custom folder. For example- Custom added in both these places. You don't need to change the CodeFile= because it's relative to the folder the page is in.
public partial class ConLib_Custom_RegisterDialog : System.Web.UI.UserControl

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RegisterDialog.ascx.cs" Inherits="ConLib_Custom_RegisterDialog" %>

Edit:
You also need to make sure that your scriplet is using ConLib:Custom/RegisterDialog instead of ConLib:RegisterDialog
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

europhile
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Fri Jan 23, 2009 3:05 am

Re: Overiding with the ConLib Custom folder doesn't seem to work

Post by europhile » Tue Feb 10, 2009 8:30 am

Yes, that's what I said, I am editing the ConLib\Custom .ascx file but it doesn't make any difference!

Have you definately left an original filename.ascx Control the same but changed the ConLib\Custom filename.ascx with same name, which then overrides it? Because it doesn't seem to override on mine. Phil.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Overiding with the ConLib Custom folder doesn't seem to work

Post by mazhar » Tue Feb 10, 2009 9:12 am

ConLib/Custom controls doesn't override the default ones. You need to update the locations to make use of the new control from custom folder.

europhile
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Fri Jan 23, 2009 3:05 am

Re: Overiding with the ConLib Custom folder doesn't seem to work

Post by europhile » Tue Feb 10, 2009 9:26 am

Thanks but your edit above has an answer (ie. use conLib\Custom) but the point is - see your thread "Customizing display pages" and Joe's reply (would've posted there but its a longer thread and this is a specific problem):
4. You copy a "built-in" user control into ~/ConLib/Custom and make sure the file name is the same as the original. Then you make changes to it.
AC7 will override the "built-in" user control and use the modified copy you placed in ~/ConLib/Custom. The original remains as it was.

5. You create a brand new user control and store it in ~/ConLib/Custom.
You will be able to reference this custom control on any scriptlet page using the format [[ConLib:Custom\<filename>]]. Be sure to reference it without the .aspx extension. It used to require the extension but this was changed when Beta went to RC1.
His #4 is what should be achievable, but you are recommending dropping down to #5, which means you have to mess about adding the Custom to every ConLib that references the overriding control. Hassle, and from the thread - should be unnecessary.

So back to original question, does it (#4 method) work - because it doesn't seem to on mine? Phil.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Overiding with the ConLib Custom folder doesn't seem to work

Post by mazhar » Tue Feb 10, 2009 9:42 am

#4 will not work. You have to go with #5

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

Re: Overiding with the ConLib Custom folder doesn't seem to work

Post by jmestep » Tue Feb 10, 2009 9:43 am

#4 doesn't work, and I don't know if it ever did. I think old Able documentation might have said it worked that way.
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

europhile
Ensign (ENS)
Ensign (ENS)
Posts: 14
Joined: Fri Jan 23, 2009 3:05 am

Re: Overiding with the ConLib Custom folder doesn't seem to work

Post by europhile » Tue Feb 10, 2009 10:02 am

Right, phew, glad we sorted that out. Thanks for your help, Phil.

NB: Hope this can be implemented in upgrade mazhar, it would save a lot of fannying around as the underlying idea and method in Scriptlets is an excellent one (ie. auto override) :)

Post Reply