Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Midnight Modding Posted November 8, 2018 Posted November 8, 2018 I have another complicated situation. A client has someone else customize some of my templates. I suggested either designer mode or even editing my dev phtml files directly. They, however, just edited the templates normally in the acp for his custom skin… Even though it's not really on me, I'm still trying to help sort it out and wondering about the process for being able to use it that way. He did the following after they were finished: uninstalled my app reinstalled it customizations then didn't show anymore so he re-imported the customized skin then the custom skin was there twice, but every time one was uninstalled, the customizations disappeared from the front end again he then uninstalled both skins and imported it again to get it to work Long story short(er), somehow now his custom skin in the acp is id 14, his themes/ directory has no id 14... but has a 10. His uploads/ does NOT have a 10 for the resources, but has a 14.... AND to top that off... for my app, some pages are looking for the resources in id 10 and some are looking in id 14!!! But only one of those directories even exists. How can it even look for them in different places? Is it dependant on whether the given page is using a modified template or unmodified one? I thought it would always look in the same id directory regardless.
Midnight Modding Posted November 9, 2018 Author Posted November 9, 2018 In case that is still confusing... the acp list of themes has a 14, but no 10. the themes/ directory on server has a 10, but no 14. the uploads directory has resources for 14, not 10. The {resource=""} in my app sometimes looks in 14 and sometimes in 10, depending on the page. This is bonkers. I have no idea what he/they did. lol. And my questions are: what happened to cause all of that weird behavior? what process should the designers have done to customize some templates of my app in a custom skin for him? what's the best way to move forward with it, given they did edit them directly in the acp? Should the app be installed, then the skin imported? This should really be on them to fix, but I like doing my best to help figure things out.
bfarber Posted November 9, 2018 Posted November 9, 2018 themes/ is only created/updated/written for designers mode. So to answer your question, he (or someone) turned designers mode on while id 10 still existed, then turned it off. Installing or uninstalling themes after that point will not update the designers mode directory on disk. You can just delete the themes/ folder entirely in fact at this point if designers mode is off. Designers can either use designers mode or edit the templates from the AdminCP, including the templates for your custom app. Generally you just (1) install the app, (2) create the theme.
Midnight Modding Posted November 9, 2018 Author Posted November 9, 2018 4 hours ago, bfarber said: themes/ is only created/updated/written for designers mode. So to answer your question, he (or someone) turned designers mode on while id 10 still existed, then turned it off. Installing or uninstalling themes after that point will not update the designers mode directory on disk. You can just delete the themes/ folder entirely in fact at this point if designers mode is off. Designers can either use designers mode or edit the templates from the AdminCP, including the templates for your custom app. Generally you just (1) install the app, (2) create the theme. In this case, he had the theme created on a test site. So for his live site, is it as simple as installing my app and then importing the theme form the test site? That's close to what he already did, but there are all of these issues. Do you know why some pages of my app would be looking for resources in id 10 still when 10 is the one he uninstalled? Is it possible designer mdoe was left on and is causing some sort of issue? Thanks! btw, I'll read up on designer mode, which I assume I'll figure out, but just in case... in designer mode, they edit files or they still edit templates in the acp?
bfarber Posted November 12, 2018 Posted November 12, 2018 When designers mode is enabled, a folder /themes/ is created with each theme's resources (CSS, resources and HTML templates) underneath the theme folder. If designers mode is not enabled on the site, that themes folder is never looked at or read.
Midnight Modding Posted November 12, 2018 Author Posted November 12, 2018 5 hours ago, bfarber said: When designers mode is enabled, a folder /themes/ is created with each theme's resources (CSS, resources and HTML templates) underneath the theme folder. If designers mode is not enabled on the site, that themes folder is never looked at or read. yes, I understand that, but what I am asking is why are some pages in my app looking for the resources in the uploads resources directory for id 10 and some are looking for them in the uploads resources directory for id 14? In all cases I use the {resource=""} replacement, yet on some pages it looks for them in one id's folder and for other pages it looks in a totally different id's folder, which obviously does not even exist. On one page images weren't showing up because it was oddly looking for them in a non-existent directory, whereas other pages looked for them in the correct one. That makes me assume it's related to whether or not the specific page's template was edited or not, but I would have assumed it would look in the same id number regardless. If you import a skin, surely it's not supposed to have a hardcoded id set number attached to it from the site it was created on, and only for its non-customized templates.
Pete T Posted November 12, 2018 Posted November 12, 2018 7 minutes ago, Midnight Modding said: yes, I understand that, but what I am asking is why are some pages in my app looking for the resources in the uploads resources directory for id 10 and some are looking for them in the uploads resources directory for id 14? In all cases I use the {resource=""} replacement, yet on some pages it looks for them in one id's folder and for other pages it looks in a totally different id's folder, which obviously does not even exist. On one page images weren't showing up because it was oddly looking for them in a non-existent directory, whereas other pages looked for them in the correct one. That makes me assume it's related to whether or not the specific page's template was edited or not, but I would have assumed it would look in the same id number regardless. If you import a skin, surely it's not supposed to have a hardcoded id set number attached to it from the site it was created on, and only for its non-customized templates. I never seen different images loading different ID unless that was hard coded into the theme because when upload image via ftp or manage resources in Admin CP it will just normal upload to folder you have selected and call the image and format of image example pic.png will become {resource="pic.png" app="core" location="location you chosen"}
Midnight Modding Posted November 12, 2018 Author Posted November 12, 2018 12 minutes ago, Pete T said: I never seen different images loading different ID unless that was hard coded into the theme because when upload image via ftp or manage resources in Admin CP it will just normal upload to folder you have selected and call the image and format of image example pic.png will become {resource="pic.png" app="core" location="location you chosen"} yes, it's done just like your example, no hardcoding an id. I somehow end up in the weirdest situations. lol. Basically, the client had them edit my templates in a custom skin on his test site (which they apparently did in designer mode). He then uninstalled my app and re-installed my app fresh. At that point, their custom skin changes were not showing up on the front end anymore. So he panicked and imported a copy of his custom skin at the same time the original copy was there. That fixed it, but then uninstalling either custom skin made the changes disappear. So he uninstalled BOTH custom skins, and re-imported one and then it ended up like this where one page is looking in the wrong directory. lol. So I'm not sure what happened, but hopefully it was due to that weird set of steps and won't happen again on his live site. Still very odd it's looking for those images in the wrong place, though. I'll look again to be sure 100% I didn't overlook where maybe the designers hardcoded something.
Pete T Posted November 12, 2018 Posted November 12, 2018 45 minutes ago, Midnight Modding said: yes, it's done just like your example, no hardcoding an id. I somehow end up in the weirdest situations. lol. Basically, the client had them edit my templates in a custom skin on his test site (which they apparently did in designer mode). He then uninstalled my app and re-installed my app fresh. At that point, their custom skin changes were not showing up on the front end anymore. So he panicked and imported a copy of his custom skin at the same time the original copy was there. That fixed it, but then uninstalling either custom skin made the changes disappear. So he uninstalled BOTH custom skins, and re-imported one and then it ended up like this where one page is looking in the wrong directory. lol. So I'm not sure what happened, but hopefully it was due to that weird set of steps and won't happen again on his live site. Still very odd it's looking for those images in the wrong place, though. I'll look again to be sure 100% I didn't overlook where maybe the designers hardcoded something. I never seen issue like this as like bfarber said the /theme/ folder only made when use designer mode and then create the ID folders for the theme in Admin CP and most dev upload images via ftp or manager resources so would matter if designer had upload images in ID 44 and your client was ID 2 because would see the image via this {resource="pic.png" app="core" location="location you chosen"}.
Midnight Modding Posted November 12, 2018 Author Posted November 12, 2018 6 hours ago, Pete T said: I never seen issue like this as like bfarber said the /theme/ folder only made when use designer mode and then create the ID folders for the theme in Admin CP and most dev upload images via ftp or manager resources so would matter if designer had upload images in ID 44 and your client was ID 2 because would see the image via this {resource="pic.png" app="core" location="location you chosen"}. edit: *dies*. they DID hardcode it. When I was looking for issues, I must have looked only in my own copy and not his. Kind of annoying I spent this time looking into it and the designers are who did it, but oh well... I think I accidentally was looking at the wrong images when I double checked the first time. They even hardcoded it to his exact url, too, so on his live site it will be all screwy. lol.
Midnight Modding Posted November 12, 2018 Author Posted November 12, 2018 Thanks for reminding me to check it. This was really the only way it makes sense for it to have done that. Still not sure why they did it, but oh well, I'll fix it for him myself... Like I said, I "thought" I already checked for anything being hardcoded, but must have missed it. edit: I fixed it and see why they did it now... I didn't originally have those images even in that template and they clearly didn't know how to get them in it in an automated way, so they even hardcoded it for each type separately instead of the few lines needed to have it work for all types. Anyway, so I fixed it all now after a headache of figuring out what they did. They probably didn't know the php side of it well.
Midnight Modding Posted November 12, 2018 Author Posted November 12, 2018 ok so my last question on this... when "I" edit his templates in that custom skin, is it going to mess anything up that I am doing it with designer mode off? I edited the templated directly and this eneds to be imported on his main site. I really should hire someone to do design work when I make apps because I just hate it. I'm surprised I even got most pages looking decent. They also put the css straight into the templates.... which I really didn't know if that would even work since we can't put direct js in them, for instance.
Pete T Posted November 13, 2018 Posted November 13, 2018 8 hours ago, Midnight Modding said: ok so my last question on this... when "I" edit his templates in that custom skin, is it going to mess anything up that I am doing it with designer mode off? I edited the templated directly and this eneds to be imported on his main site. I really should hire someone to do design work when I make apps because I just hate it. I'm surprised I even got most pages looking decent. They also put the css straight into the templates.... which I really didn't know if that would even work since we can't put direct js in them, for instance. You can load CSS into templates yes but not the best method Vs adding CSS into custom.css if it's adding extra item to theme not ship out as default, but hardcoding images into theme that new one it's like good cold days all over yeah understand if maybe images was off site eg if limited to space then uses aws.
Midnight Modding Posted November 13, 2018 Author Posted November 13, 2018 2 hours ago, Pete T said: You can load CSS into templates yes but not the best method Vs adding CSS into custom.css if it's adding extra item to theme not ship out as default, but hardcoding images into theme that new one it's like good cold days all over yeah understand if maybe images was off site eg if limited to space then uses aws. I think on a lot of what they did, they just hadn't worked in 4.x and just did it however they could. But how they thought hardcoding links to his test site's directories would be a good idea beats me. But oh well. So what about my editing of the templates when not in designer mode? I edited around 4 template bits on his custom skin. If he exports it will it be fine on his other site or should I have done something in designer mode? Hopefully minor tweaks to templates is ok not in designer mode and will still export everything fine.
steve00 Posted November 13, 2018 Posted November 13, 2018 Depends what templates If physically altering any of the IPS default templates/css files then there could be issues when upgrading in the future as they will not get overwritten with new templates/css files All css should be added to the custom.css file Cannot answer regarding any hooks/mods that add their own templates/css files as not tried that but would imagine they would not get overwritten and would be left to the hook/mod author to update those files if required for future IPS upgrades Hope that helps
Midnight Modding Posted November 13, 2018 Author Posted November 13, 2018 11 hours ago, steve00 said: Depends what templates If physically altering any of the IPS default templates/css files then there could be issues when upgrading in the future as they will not get overwritten with new templates/css files All css should be added to the custom.css file Cannot answer regarding any hooks/mods that add their own templates/css files as not tried that but would imagine they would not get overwritten and would be left to the hook/mod author to update those files if required for future IPS upgrades Hope that helps thanks. yeah I know they won't get overwritten (even for third party apps, that is the same way). I just wasn't sure if the re would be some other issue just by the fact that it's not in designer mode, but I don't "think" there would be. These are all my own app's templates I edited. As for the css, I just left that to the designers he used. If "I" had done it, I would have put it in my app's css file. I think they should have done something different than they did, but I don't think it's any issue, just not the ideal way of doing it.
bfarber Posted November 14, 2018 Posted November 14, 2018 Developers working on an app adjust their default core templates and CSS from the application/dev/ folder. Generally you create a generic layout and styling that will work for everyone using your app. Designers can then come along when your app is done and either use designers mode to customize the theme, or edit the templates and CSS directly in the AdminCP. Essentially, you should just not care about the theme at all. Test your app with a completely default unmodified theme (which will use your default templates and CSS) and if things work properly, the issue is with the custom theme and you should refer the client to whoever created that custom theme.
Midnight Modding Posted November 14, 2018 Author Posted November 14, 2018 yes, I know, it's not up to me to take care of their process, but since he was having problems and is a good customer, I was trying to help him out. The app was finished, but I was fixing their design issues in those few templates. They also added some folder of images, so I'd rather add those to my resources directory instead, but that would be a pain and he doesn't want me to fool with it, so I'll just leave that as it is where he uploads their directory.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.