Clarification on adding a post style
-
June 5, 2020 at 1:33 am #2945
[anonymous]
I started to being conformable to override theme
and injecting custom CSS/JS/HTML codes directly in ./input/config/
but I didn’t succeed to add a new post style as described here https://getpublii.com/dev/how-to-create-custom-templates/#js-header
I add this in config.json file of my simple-override folder
}, "postTemplates": { "services": "Human readable template name" }and simply copy post.hbs from the simple folder to simple-override/post-services.hbs
so now when I write a new post I see the Other options and Post Templatebut the dropdown menu is gray and say Not available in your theme.June 11, 2020 at 12:07 pm #3007
[anonymous]
Hi,
It seems that config.json override is not supported :/ I will add it in v.0.37 release which will be focused on the theme development improvements.
November 18, 2020 at 4:49 pm #4557
[anonymous]
I generally tried to just add a new post template without overrides, following same tutorial
https://getpublii.com/dev/how-to-create-custom-templates/#js-headerBut also just see a grayed out dropdown.
I added a post-services.hbs file (it just just a copy of post.hbs with changed name)
Publii/app/default-files/default-themes/simple/post-services.hbs
And then I have edited
Publii/app/default-files/default-themes/simple/config.json
and added
"postTemplates": { "services": "Human readable template name" },but with not success.. another try was to add this code also to
Publii/app/default-files/theme-files/config.json
but no success either.
Am I missing something?
November 18, 2020 at 4:55 pm #4558
Bob
Publii/app/default-files/default-themes/simple/post-services.hbs – it’s wrong file location.
You should work in this area: Documents ▸ Publii ▸ sites ▸ YOUR_SITE ▸ input ▸ themes ▸ YOUR_THEME
November 18, 2020 at 5:57 pm #4560
[anonymous]
Hmm.. I tried it and still no success… or at least partially..
I found out one thing – when I run Publi over npm run dev and then npm run build the options are there. But if I used a precompiled application the options are not visible… Might it be it has something to do with caching?November 18, 2020 at 6:13 pm #4561
Bob
By default, both versions use the same site files. Are you sure you have made changes to both files in this location: Documents ▸ Publii ▸ sites ▸ YOUR_SITE ▸ input ▸ themes ▸ YOUR_THEME ?
If yes, please attach your website backup here (Private Reply).
November 18, 2020 at 7:08 pm #4562
[anonymous]
This reply has been marked as private.November 18, 2020 at 7:23 pm #4564
Bob
This reply has been marked as private.November 19, 2020 at 9:37 am #4574
[anonymous]
Answer is not visible 🙁
November 19, 2020 at 9:46 am #4575
Bob
Something is wrong with your site, many files are missing, after importing to Publi it doesn’t work. It will take some time to figure out why and what is happening, so I really don’t have time for that. Send me the mentioned by you in the previous message input folder instead of a corrupted backup.
November 19, 2020 at 10:06 am #4576
[anonymous]
I just checked and have set setting in App Settings ▸ Files Location ▸ Sites Location back to default.
With this done, everything works as expected.It looks like there is something wrong when having the sites in different location. I will investigate a bit more in the code today and keep You updated Bob.
November 19, 2020 at 3:20 pm #4584
[anonymous]
Found out the reason, I edited the
Documents ▸ Publii ▸ config▸ app-config.json manually (reason for that was a broken app (path I wanted to change to was somehow wrong initially and Publii was crashing).The fact that it was a manual change is causing Publii to not run a lot of important file operations.
I have re-saved the path from Publii directly and my settings as well as as filesystem is fixed now.And adding template files works as well now!
November 19, 2020 at 3:22 pm #4585
Bob
Good news.