CMS Development

saj1ad
Member

My Custom Theme Not Showing For Selecting It As Active

SOLVE

We have developed a custom theme based on boilerplate theme. And when trying to select template for 'Blog Listing Page' and going to change theme our theme is not showing up, default Hubspot marketplace themes are showing only!! Theme is showing under themes management folder and we have published the theme after clicking save, see below attached images.

 

https://prnt.sc/ZqUiSBhD9CNL

 

https://prnt.sc/9i6C4ZGnWZkZ

0 Upvotes
1 Accepted solution
Jnix284
Solution
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

@saj1ad does your custom theme have a theme.json?

 

and if so, have you set it to be available for new content?

  "is_available_for_new_content" : true,

 

Here's an example from POWER Pro theme:

Jnix284_0-1705711074453.png

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

View solution in original post

0 Upvotes
20 Replies 20
Jnix284
Solution
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

@saj1ad does your custom theme have a theme.json?

 

and if so, have you set it to be available for new content?

  "is_available_for_new_content" : true,

 

Here's an example from POWER Pro theme:

Jnix284_0-1705711074453.png

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
MNongrum
Member

My Custom Theme Not Showing For Selecting It As Active

SOLVE

Screenshot 2024-02-28 215906.png

Help me!!!....I did everything you said above but it is still not appearing the the choose  theme page when I create a page

0 Upvotes
Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

@MNongrum do you also have the corresponding theme files in design tools? Can you share the file structure you've configured?

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
MNongrum
Member

My Custom Theme Not Showing For Selecting It As Active

SOLVE

Here is the screenshotScreenshot 2024-02-28 222339.png

Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

@MNongrum everything looks correct, can you try going to Settings > Account Defaults > Branding > My Brand Kit and see if you can set your theme as the default?

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
MNongrum
Member

My Custom Theme Not Showing For Selecting It As Active

SOLVE

it is not appearing there!!!

0 Upvotes
Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

ok, thank you for confirming @MNongrum - did you code directly in the UI or did you upload via the CLI?

 

I found the mistake in your theme.json, based on your file directory, you have:

 

Practicum > Templates > basic-page.html

 

but in your code, you're preview_path has two dots instead of one.

 

You have:

  "preview_path" : "../templates/basic-page.html",

and it should be:

  "preview_path" : "./templates/basic-page.html",

 

Can you update and confirm?

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
EdCupaioli
Contributor

My Custom Theme Not Showing For Selecting It As Active

SOLVE

The other solution is that you just make those values null since they're just decorative for the theme selection screen. Example: 

{
  "preview_path" : null,
  "screenshot_path" : null
}

 

@MNongrum Do you have your local setup configured? the CLI is sometimes helpful in letting you know if there's an error. Though I tested a bad path in my theme.json and I recieved no warnings 😞 . Theme still works ¯\_(ツ)_/¯

 

It's odd to me that the CLI doesn't have warnings for stuff like that. I noticed warnings for other misnomers but any core theme stuff that's necessary for the function of your theme is ignored. As a developer, I would expect a breaking change to get caught and reported. 

MNongrum
Member

My Custom Theme Not Showing For Selecting It As Active

SOLVE

So, I uploaded it via the CLI...

 

Well, I have tried that but it still does'nt work

EdCupaioli
Contributor

My Custom Theme Not Showing For Selecting It As Active

SOLVE

Good deal. I'm working on a blank template as well so I'm going to unsub to this thread for now so I can lock in and figure out how this works. The main lesson I'm learning here is that you should always use the boilerplate 😉

 

Thanks for all your help thus far @Jnix284 

Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

You're welcome @EdCupaioli, 100% boilerplate for anything new (aside from practicum, which is the issue here... 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

Hmm...I'm not sure what it could be, can you try a log in/out and refresh to see if you can trigger the theme to appear when creating a page?

 

Could be a server delay - the account doesn't see the files yet.

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
MNongrum
Member

My Custom Theme Not Showing For Selecting It As Active

SOLVE
It's working now
EdCupaioli
Contributor

My Custom Theme Not Showing For Selecting It As Active

SOLVE

@MNongrum That's good news. I did some digging but I couldn't actually find why a theme wouldn't be populated. Mine magically appeared too so I tried creating a test them locally with the barebones. I noticed that if I did not have any page templates, the theme would not appear in the template selector. However, if I went to the Settings > Website > Themes panel, I could see the theme. I think what might have happened is that the page template file was malformed or simply not uploaded, the latter being more likely. 

 

I found that the CLI is a bit wonky. When I run the watch command, I would expect changes would be communicated to Hubspot when I edited, removed, moved, or added a file. Watch will ONLY communicate edits. Each of the move, remove, and add options have to be done separately. I found that using git was better for most local development scenarios since all edit, adds, moves, and removes are tracked and version controlled. The only scenario where the UI is convenient is in the creation of module fields. Just make sure to run hs fetch [theme src] [theme dist] after you add fields to the module. Also, the CLI can be used to create all types of folders (themes, templates, modules, etc) that would be tedious to do from scratch. The hs create template command makes a boilerplate ready to roll and you can create a module with hs create module, but you'd need to enter the field.json schema and module.html HubL manually. I'm used to doing that from my JAMstack experience but that UI is too darn convenient. 

Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

Awesome, glad to hear it @MNongrum - best of luck with the practicum!


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
EdCupaioli
Contributor

My Custom Theme Not Showing For Selecting It As Active

SOLVE

I'm experiencing the same issue. I started from a blank theme as well since I'm completing the practicum for the certification. Boiler plate themes add with no issues, but blanks are not recognized. here's my theme.json: 

{
"label" : "Ed Practicum",
"preview_path" : null,
"screenshot_path" : null,
"enable_domain_stylesheets" : false,
"is_available_for_new_content" : true,
"author" : {
"name" : "Ed Cupaioli",
"email" : "ed.cupaioli@gmail.com"
},
"hide_all_default_modules" : false
}

I orignially developed locally and pushed up but no dice. I then when through the UI to create a new blank theme and no dice on that either. I'm assuming there might be some other requirements to make a theme available but docs don't point to anything. 

EdCupaioli
Contributor

My Custom Theme Not Showing For Selecting It As Active

SOLVE

I'll reply to my own post here to answer my question and hopefully OP's: 

 

I was able to see my theme when I went back to create a new page. not sure how or why that worked but it did. I added back in all of my file structure (templates, modules, partials, templates, etc)  and voila, it appeared. I would assume the existance of the file structure HubSpot expects in a theme spurred it's appearence. But again, the docs don't really give out that information. For now, it's guess and check until it works 😞 

Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

@EdCupaioli I'm glad you got it resolved, I also recently completed the practicum and coded it entirely through the UI, it was visible from the editor as soon as I created the initial theme structure.


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes
EdCupaioli
Contributor

My Custom Theme Not Showing For Selecting It As Active

SOLVE

got it, so theme structure is required. I'm doing it the hard way since I'm a JAMstacker but that UI was really helpful for making the modules and sections. 

Jnix284
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

My Custom Theme Not Showing For Selecting It As Active

SOLVE

The CLI is better for actual dev work, but for the practicum requirements it was a lot easier for me to build it all natively in the UI. Especially with modules and sections, being able to copy the JSON from the fields, etc.

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Delivery Lead at Aptitude 8

connect with Jen on Linkedin

0 Upvotes