Concrete 5 7.2.1 - Design and Custom Template Settings drop down not showing up

Permalink 1 user found helpful
I just installed a new site using 5.7.2.1 tonight, and I am trying to add some custom templates. I set up a site in concrete 5.7.2, and I had no problems with this at all. I created a custom autoNav (which was copy-and-paste from my working site)


This time in my new theme, when I select "Design and Custom Template," the settings drop-down which allows me to select my new template does NOT show up. I copied a lot of the working code from my first template, but changed the namespace in the pagetheme.php (where I changed the name) but I can not get this option to work at all in the new template.

What am I missing out? How can I get this settings dropdown to appear?

 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi eckleyval,

Where did you put the custom template file?
eckleyval replied on at Permalink Reply
I put it in the application/blocks/autonav/ folder, just like I did with my first site.
Thanks :)
juddc replied on at Permalink Reply
juddc
Did you try changing the namespace in the block's controller.php?

<?php
namespace Application\Block\Autonav;
eckleyval replied on at Permalink Reply
didn't do anything :/

I have found out that I can not access ANY of the functions on the design and custom template menu anywhere in the site. The buttons don't do anything and the drop down menus don't ever show up. I made sure that there was no z-index conflict too.

I even took out all my custom CSS and I am still not able to use the design menu :/

So I took out my jquery.js and boostrap.min.js in my template. I found a conflict with the boostrap.min.js.

I have this loaded my my template
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
 <script src="<?=$view->getThemePath()?>/js/bootstrap.min.js"></script>


and this is my page_theme.css

I think there might be something funky going on in here
[code]
<?php
namespace Application\Theme\wovenBook;
use Concrete\Core\Page\Theme\Theme;
class PageTheme extends Theme
{
protected $pThemeGridFrameworkHandle = 'bootstrap3';

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');
}
public function getThemeBlockClasses()
{
return array(
'Navigation' => array(
'nav navbar-nav'
)
);
}
}
[code]
juddc replied on at Permalink Reply
juddc
Hrm. Did you try ditching jquery in your template and relying on the version loaded up by concrete instead?
eckleyval replied on at Permalink Reply
yes I did... and boostrap is what seems to be the problem. I took out all references to bootstrap in the page_theme.php and it still isn't working right.

I also can't get the boostrap grid system to work either.
webporter replied on at Permalink Reply
webporter
Heya

I was having the same problem just now. None of the options in the "Design & Custom Template" menu bar were working.

My theme (custom web design coded in Bootstrap) also uses Bootstrap.min.js. I tried simply took that link out and now it works!

Not sure what the conflict is though... :(

- Mal
eckleyval replied on at Permalink Reply
yeah :/ to bad I need to use boostrap.min.js in my theme... if I take it out and do the settings and put it back in it will work, but I can not expect a client to do that
webporter replied on at Permalink Reply
webporter
From memory, there is some code that you can add that allows you to change the template when in edit mode... maybe that could help?

<?php
global $c;
if ($c->isEditMode()) {do something;}
?>


but instead you could check "if _not_ in edit mode" add then add the link to the bootstrap.min.js?

Cheers
tilde replied on at Permalink Reply
Your suggestion is good, and it works.
I placed this code in my footer:

if ($c->isEditMode()) {
   }
   else { ?>
       <script src="<?php echo $this->getThemePath()?>/js/bootstrap.js"></script>
   <?php } ?>


And now both boostrap is working and also I have access to custom templates when in edit mode.

Thanks for the hint
webporter replied on at Permalink Reply
webporter
Hi again -- I came across a fix:
http://www.concrete5.org/documentation/developers/5.7/designing-for...

"Add a DIV around the content of the page (typically right after the opening of the body tag and before the closing of the body tag) and give it this class

<div class="<?php echo $c->getPageWrapperClass()?>">

Fix various CSS issues where the theme you've chosen might conflict with the concrete5 theme."

I added that page wrapper DIV and added back the bootstrap.min.js and it's all working now!

Cheers
andrew replied on at Permalink Reply
andrew
That's great to hear – yeah, this DIV is pretty crucial. It adds classes to the page that the panels and UI JavaScript needs to function.
webporter replied on at Permalink Reply
webporter
oops Andrew - I celebrated too early :(

I had forgot to add the themepath to bootstrap.min.js when I put it back in my template, so it wasn't really getting loaded when I tested the drop down. Now that it's loading correctly, the "Design & Custom Template" menu bar is not working again :(
webporter replied on at Permalink Reply
webporter
Andrew - should I submit the conflict with bootstrap.min.js as a bug?

Because anyone using that framework and that JS would come across the same issue... and I am not sure if the conflict is because C5 uses Bootstrap also or for some other reason.
Continuity13 replied on at Permalink Reply
I'm running into this problem, as well, where if I want to use the Design and Custom menu, the buttons don't work; this despite following all of the steps correctly in setting up the HTML, including the page wrapper class.

Is there a fix for this?

***UPDATE***

A couple of minutes after posting the above, I came to realise that there might be a conflict with Bootstrap's JavaScript file.

Indeed there was.

I had included my own boostrap.js, whilst concrete5's Bootstrap related files were also being called. Removing my own bootstrap.js call solved the problem.
andrew replied on at Permalink Reply
andrew
Yes, you may want to investigating informing concrete5 that your theme includes a modified version of bootstrap, and tell Concrete5 that it [b]shouldn't[/b] include its own bootstrap. You can do that with information from this page

http://www.concrete5.org/documentation/developers/5.7/designing-for...
eckleyval replied on at Permalink Reply
The odd thing is I thought I had overwritten it when I had this problem in the first place.
I went ahead and redeveloped by site on my other working theme. Odd because it was the same code.
tduncandesign replied on at Permalink Reply
tduncandesign
Also ran up on this issue in 5.7.4; my version of Bootstrap includes the dropdown.js, but C5 was also supplying, so I added
$this->providesAsset('javascript', 'bootstrap/dropdown');

to my page_theme.php asset registration list, that fixed it.