So I wanted to add a new page template to my theme... Following the instructions, (in a copy, not the published theme, of course, so that I don't risk messing things up), I created a new template file. Great. After making the new template file in the templates folder, I click on "online store" in my admin, click on "pages" and lastly, click "add page". Put in a title and a bit of content and then go to choose the template suffix. My newly created template isn't there. Double check the templates folder. Yes, it's there. Go back to the "add page" page, still can't choose it. After scratching my head for a while, I discover this line (https://help.shopify.com/themes/customization/store/create-alternate-templates#sectioned-themes):
"Only templates present in your published theme will be available in the Theme templates section."
Maybe I'm missing something obvious but I don't understand how this is supposed to work. The whole point is to work on a copy, is it not? Not only that, but I'm using Theme Kit, which is uploading any changed file up to my copy.
So just to get this straight... In order to add a new (usable) template, you have to create it in the templates folder of the PUBLISHED theme in order to be able to access it from the copy. OK, fine. BUT! When I'm finally finished tweaking my copy and want THAT one to be the published version, what happens then? All of a sudden, the now-published theme (previously a copy) doesn't contain the template file I created! I guess the page isn't going to render properly, is it? (Or at all?)
So is the "correct" (in quotes because it seems more like a workaround than a well-thought out procedure) way to do things to create a new template in the templates folder of the active theme first, then copy/paste it to the "copy of theme" that you're working on? And I assume you need to do that every time you make any changes to it, correct?
This can't be right...
OMG, it gets even crazier than I originally realized. The only way I can figure out to add a new page template and use it is on the active theme! This seriously cannot be right...
In the active theme, this is what I did:
I then made a duplicate of the active theme and deleted the css file and css reference in theme.liquid of the active theme. I left intact the page template and the page itself. Then tried to view the page but the heading wasn't blue anymore.
Is there really no way to do all of this in a duplicate so that we don't risk screwing up the currently published theme? This is absolutley total insanity. Doesn't it make the entire point of working on duplicates moo (as Joey would say)? If you add any custome page templates, the only way to see them is in the active theme?
it's not like this. You have to have a template with the same name in the active theme, but it may be empty. It's only needed to tell Shopify that there exists alternate template with this name, so it can populate the "Templates" drop-down on the object page in admin.
It is only needed to assign an alternate template to an obect (say, product).
Note that you can always use ?view=alt-template-name at the end of your URL to see the alternate template (even when previewing unpublished theme and there is no such template in active theme).
You say "Then tried to view the page but the heading wasn't blue anymore." -- have you tried it via Preview link of your development theme?
Obviously, in your active theme it would not be blue, because these CSS rules and not there anymore...