(U4.8) Finding hard-coded hours in calendar template
Hi. I'm very new to Umbraco and have been handed a site that's on v4.8, which, as I understand, is pretty old. Fun times.
This site is for a company that has many different storefronts, each with their own unique store hours. This is already set up on the site and works perfectly.
However, there's also a holiday-specific section that looks like this below:
And it doesn't work in the least. I'm guessing that's in some way due to the fact that the dates on the right are all old.
So that's my question: Where might one look to see if those dates are hard-coded into the system? I've poked around the templates and modules and all that and haven't been able to find anything relevant. Thanks for any assistance.
The above looks like either a custom datatype or the "openinghours" datatype, which is an official package.
But I think that you may need to search your solution for the property name of the above control to figure out where it is being used and to figure out where you might need to go to change things.
Do you know your way around Umbraco? Otherwise on the document in the content section where you see the above opening hours go to the "property" tab and see what the name of the document type is. Then you can go to the "Settings" section and find the document type where you can then see the property alias, which you should try and do a search for in your source code.
I hope you have got full access to the source code at least :) - Hope these pointers help somewhat.
I think you might be right about it being a custom data type. When I go into "data types," I see something called "Work Hours picker." When I click that, on the right side, there is an entry in the dropdown "usercontrol" which is selected as:
/usercontrols/customproperties/StoreHours.ascx
Which certainly seems like a thing I should be looking at. But since it's only an item in the dropdown, I'm uncertain how to find or edit the .ascx file.
I think I have full access to the source code -- I'm using "admin" to log in -- but then, I suppose I wouldn't know if I did not. I'm familiar with the WordPress model where you do many things from inside the CMS, but other things in PHP via FTP. I'm not certain if there's that external component to Umbraco or if everything should be done through the interface. (I'm ~three days into my initial Umbraco experience.)
If you have access to the filesystem of your Umbraco installation, then you should find a folder called usercontrols, I think if you go into this folder, then you will see the customproperties folder, and in this folder you will find the StoreHours.ascx.
In order to be able to see the full source code you need to have access to the file system and have access to the non-compiled version of the source code. Otherwise you'll probably not be able to do much about it.
However, before we go further into that let's see if it's at all neccessary. But finding th StoreHours.ascx is not going to be enough if it's done purely in ASP.NET Webforms since you need access to the codebehind file as well (.cs).
What you can access from inside Umbraco or the FTP client is all compiled code - Which may be fine if the rendering is done using XSLT or Razor. But if it's done using a user control you won't be able to do much just having access to the .ascx file.
If you go to the "Developer" setting in Umbraco and expand the "XSLT" folder...does it contain any files? And how about if you expand the "MacroScript" folder? I'm trying to figure out wether or not what you need to change is in a XSLT or Razor file, which I hope since that means you'll probably be able to amend things.
Also...could you, in the same section, expand the "packages" folder and see the installed packages? Does the list contain the "opening hours" package?
Thanks to you both. Dennis, yes, I just a minute ago received that access and found the right file. However, as Jan guessed, there's not much to be done with it.
Jan, to your inquiries:
1 -- XSLT folder -- five files, relating to header & footer nav, google sitemap, display image
2 -- MacroScript -- no folder by this name, but the similarly-named "Macros" has approx. 50 files, all named in ways that seem custom to this site. One is named "[Module]Center Hours" which seems promising.
3 -- Packages -- 7-8 items installed but nothing related to opening hours.
Ok, can't remember the proper name of that folder then - It's a folder where Razor files are stored but good you found the macro folder since that's where the macroes you can insert into templates are defined by name and mapped to a rendering, which can be Razor, XSLT or User controls for this version of Umbraco.
So have a look at the [Module]Center Hours and see what file it's being mapped to and you should be able to get into the code and make changes.
Doesn't seem to be me to be anything here that has those old dates hard-coded.
If the answer here is "we'd need to have direct access to the site to assist further," I completely understand, though I wouldn't be able to provide that, in which case I'll do my best to keep learning and looking. Your time is much appreciated either way.
Ok, this is the usercontrol...but without you having access to the codebehind file (CenterHours.ascx.cs) I'm afraid there is not much you can do about it.
To gain access to this file it's required that you can access the visual studio project - But as I mentioned above what you have access to is the compiled code unfortunately.
Don't know if it's possible for you to get hold of the project?
Otherwise you might need to think about another way of changing the hours? You could perhaps make a new property based on a rich text editor, where you can then add the opening hours in a
for instance and then be able to control it yourself.
You're very welcome. As I mention above you might be able to chagne the property to use another datatype like a rich text editor or the "opening hours" package found in the project section of hour instead.
Could be an option if you're not able to get hold of the original source code.
(U4.8) Finding hard-coded hours in calendar template
Hi. I'm very new to Umbraco and have been handed a site that's on v4.8, which, as I understand, is pretty old. Fun times.
This site is for a company that has many different storefronts, each with their own unique store hours. This is already set up on the site and works perfectly.
However, there's also a holiday-specific section that looks like this below:
And it doesn't work in the least. I'm guessing that's in some way due to the fact that the dates on the right are all old.
So that's my question: Where might one look to see if those dates are hard-coded into the system? I've poked around the templates and modules and all that and haven't been able to find anything relevant. Thanks for any assistance.
Hi Mike and welcome to our :)
The above looks like either a custom datatype or the "openinghours" datatype, which is an official package.
But I think that you may need to search your solution for the property name of the above control to figure out where it is being used and to figure out where you might need to go to change things.
Do you know your way around Umbraco? Otherwise on the document in the content section where you see the above opening hours go to the "property" tab and see what the name of the document type is. Then you can go to the "Settings" section and find the document type where you can then see the property alias, which you should try and do a search for in your source code.
I hope you have got full access to the source code at least :) - Hope these pointers help somewhat.
/Jan
Jan -- thanks for your quick and helpful reply.
I think you might be right about it being a custom data type. When I go into "data types," I see something called "Work Hours picker." When I click that, on the right side, there is an entry in the dropdown "usercontrol" which is selected as:
/usercontrols/customproperties/StoreHours.ascx
Which certainly seems like a thing I should be looking at. But since it's only an item in the dropdown, I'm uncertain how to find or edit the .ascx file.
I think I have full access to the source code -- I'm using "admin" to log in -- but then, I suppose I wouldn't know if I did not. I'm familiar with the WordPress model where you do many things from inside the CMS, but other things in PHP via FTP. I'm not certain if there's that external component to Umbraco or if everything should be done through the interface. (I'm ~three days into my initial Umbraco experience.)
Thanks again.
Hi Mike,
If you have access to the filesystem of your Umbraco installation, then you should find a folder called usercontrols, I think if you go into this folder, then you will see the customproperties folder, and in this folder you will find the StoreHours.ascx.
Hope this helps,
/Dennis
Hi Mike
In order to be able to see the full source code you need to have access to the file system and have access to the non-compiled version of the source code. Otherwise you'll probably not be able to do much about it.
However, before we go further into that let's see if it's at all neccessary. But finding th StoreHours.ascx is not going to be enough if it's done purely in ASP.NET Webforms since you need access to the codebehind file as well (.cs).
What you can access from inside Umbraco or the FTP client is all compiled code - Which may be fine if the rendering is done using XSLT or Razor. But if it's done using a user control you won't be able to do much just having access to the .ascx file.
If you go to the "Developer" setting in Umbraco and expand the "XSLT" folder...does it contain any files? And how about if you expand the "MacroScript" folder? I'm trying to figure out wether or not what you need to change is in a XSLT or Razor file, which I hope since that means you'll probably be able to amend things.
Also...could you, in the same section, expand the "packages" folder and see the installed packages? Does the list contain the "opening hours" package?
Looking forward to hearing from you.
Cheers, Jan
Thanks to you both. Dennis, yes, I just a minute ago received that access and found the right file. However, as Jan guessed, there's not much to be done with it.
Jan, to your inquiries:
1 -- XSLT folder -- five files, relating to header & footer nav, google sitemap, display image
2 -- MacroScript -- no folder by this name, but the similarly-named "Macros" has approx. 50 files, all named in ways that seem custom to this site. One is named "[Module]Center Hours" which seems promising.
3 -- Packages -- 7-8 items installed but nothing related to opening hours.
Hi Mike
Ok, can't remember the proper name of that folder then - It's a folder where Razor files are stored but good you found the macro folder since that's where the macroes you can insert into templates are defined by name and mapped to a rendering, which can be Razor, XSLT or User controls for this version of Umbraco.
So have a look at the [Module]Center Hours and see what file it's being mapped to and you should be able to get into the code and make changes.
/Jan
Thanks. I've found that file without issue, unfortunately there's not much in here that seems like it's useful. This is the code:
Doesn't seem to be me to be anything here that has those old dates hard-coded.
If the answer here is "we'd need to have direct access to the site to assist further," I completely understand, though I wouldn't be able to provide that, in which case I'll do my best to keep learning and looking. Your time is much appreciated either way.
Hi Mike
Ok, this is the usercontrol...but without you having access to the codebehind file (CenterHours.ascx.cs) I'm afraid there is not much you can do about it.
To gain access to this file it's required that you can access the visual studio project - But as I mentioned above what you have access to is the compiled code unfortunately.
Don't know if it's possible for you to get hold of the project?
Otherwise you might need to think about another way of changing the hours? You could perhaps make a new property based on a rich text editor, where you can then add the opening hours in a
for instance and then be able to control it yourself.Hope this makes sense.
/Jan
Okay, thanks. Let me try to track down the original developers of the site about that CS file.
Thanks so much for your help -- this has been very useful.
Hi Mike,
Perhaps, you could use this package http://our.umbraco.org/projects/backoffice-extensions/openinghours instead to show opening hours on the site, then you will have full control over the code and markup.
Hope this could be a solution.
/Dennis
Hi Mike
You're very welcome. As I mention above you might be able to chagne the property to use another datatype like a rich text editor or the "opening hours" package found in the project section of hour instead.
Could be an option if you're not able to get hold of the original source code.
/Jan
is working on a reply...