Design&Custom Template does not work- conflict

Permalink
Guys,
I can't use design&custom template at all in my theme- I tried to follow the instructions fromhttps://www.concrete5.org/documentation/developers/5.7/designing-for... that shows exactly my problem but still the design&custom template tab doesn't work.

My page_theme.php I pasted in my application/themes/DHK folder is
<?php
namespace Application\Theme\DHK;
use Concrete\Core\Page\Theme\Theme;
class PageTheme extends Theme {
   public function registerAssets()
{
    $this->providesAsset('javascript', 'bootstrap/*');
    $this->providesAsset('css', 'bootstrap/*');
    $this->providesAsset('css', 'blocks/form');
    $this->providesAsset('css', 'core/frontend/*');
    $this->requireAsset('javascript', 'jquery');
}
}


Please can anybody tell me what I'm doing wrong?

 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi MatyasBauer,

If you zip your theme up and attach it with a reply, I can take a look at it.
MatyasBauer replied on at Permalink Reply 1 Attachment
Hello,
many thanks- here is my theme. My other huge problem is the auto nav - I need it to be displayed horizontally like in the html and after spending many hours I still can't achieve this. I really need any advise/tips how to do this.

Thank you once again for your time,
Matyas
MrKDilkington replied on at Permalink Reply 1 Attachment
MrKDilkington
I have attached the working version of your theme.

In the theme I commented changes made.

The reason why Design & Custom Template didn't work was because of an error in providing the Bootstrap JavaScript.
- missing *
$this->providesAsset('javascript', 'bootstrap/');
- correct asset syntax
$this->providesAsset('javascript', 'bootstrap/*');

There other issues I recommend looking into.

- you are missing default.php
"The one file every theme needs is default.php. This template is used any time a page that has a specific page template can't find a file in the theme's directory that matches the template's handle."
- the theme CSS is global, which is causing conflicts with the concrete5 interface (it is recommended to scope the CSS to the class ccm-page)
http://www.concrete5.org/documentation/how-tos/designers/easily-sco...
- you have a large number of areas that are not necessary or could be replaced with custom layouts
MatyasBauer replied on at Permalink Reply
Ok, I copied your edited theme and still the Design & Custom Template tab doesn't work- is it because of this global css scope i have right now?

Regards,
Matyas
MrKDilkington replied on at Permalink Reply
MrKDilkington
Have you cleared the cache?

Do you have caching enabled? If so, it should be disabled during development.
Dashboard > System & Settings > Optimization > Cache & Speed Settings

Is this on a live server or local?
askmaridee replied on at Permalink Reply
I'm having a similar problem. I have a page_theme.php with the following:

<?php
namespace Application\Theme\Sito;
class PageTheme extends \Concrete\Core\Page\Theme\Theme
{
public function registerAssets()
{
$this->providesAsset('css', 'bootstrap/*');
$this->providesAsset('javascript', 'bootstrap/*');
$this->requireAsset('javascript', 'jquery');
$this->requireAsset('javascript', 'picturefill');
$this->requireAsset('javascript-conditional', 'html5-shiv');
$this->requireAsset('javascript-conditional', 'respond');
}
protected $pThemeGridFrameworkHandle = 'bootstrap3';
}

While logged in if I comment out the bootstrap and jquery links I can use the Design&Custom Template options. If I log out though my pages give jquery errors as if jquery isn't loading. Why would the page_template file register these assets when I'm logged in but not when I'm logged out?
MrKDilkington replied on at Permalink Reply
MrKDilkington
@askmaridee

You are telling concrete5:
- that you will provide the full Bootstrap JavaScript in your theme
- that you want concrete5 to load its own copy of jQuery in your theme

Are you including the full Bootstrap JavaScript in your theme? If not, it will cause errors and break the interface.
MatyasBauer replied on at Permalink Reply
Yes, I cleared my cache, and I have my cache settings turned off in concrete5. I'm working on live server.

Regards,
Matyas
MrKDilkington replied on at Permalink Reply 1 Attachment
MrKDilkington
@MatyasBauer

I installed and tested your updated theme again.

The Design & Custom Template menu is available. The global CSS is causing a background color issue though, but it doesn't prevent the menu from working.

I have attached a screenshot of it.

Are you using custom blocks that you made yourself?