Concrete5.8.03 The Layout Presets
Permalink
Hi all
I am trying out the new version 8.3 and trying to get layout presets to work with my own grid system. I have lifted the following code from a 5.7 site which works perfectly but on 5.8 they don't appear as presets when adding a layout:
I have also tried adding the following with no joy but I did not have that in my working 5.7 site:
I have tried debugging with both xdebug and actually just throwing exit() within the getThemeAreaLayoutPresets() to try and determine if it is actually running and it never seems to be hit. I don't know if this is a bug with v8. Has anyone else run into this problem at all?
Many thanks in advance
All the best
David
I am trying out the new version 8.3 and trying to get layout presets to work with my own grid system. I have lifted the following code from a 5.7 site which works perfectly but on 5.8 they don't appear as presets when adding a layout:
<?php namespace Application\Theme\MyTheme; use Concrete\Core\Area\Layout\Preset\Provider\ThemeProviderInterface; class PageTheme extends \Concrete\Core\Page\Theme\Theme implements ThemeProviderInterface { public function registerAssets() { $this->requireAsset('javascript', 'jquery'); } public function getThemeName() { return t('MyTheme'); } public function getThemeDescription() {
Viewing 15 lines of 142 lines. View entire code block.
I have also tried adding the following with no joy but I did not have that in my working 5.7 site:
protected $pThemeGridFrameworkHandle = false;
I have tried debugging with both xdebug and actually just throwing exit() within the getThemeAreaLayoutPresets() to try and determine if it is actually running and it never seems to be hit. I don't know if this is a bug with v8. Has anyone else run into this problem at all?
Many thanks in advance
All the best
David
Hi MrKDilkington
Many thanks for getting back to me, I did try that before hand as I found it in some documentation somewhere with 3 available values; boostrap3, false and I can't remember the last one if I am honest, and I can't find the documentation now unfortunately, when putting them in though, I still don't see the layouts.
Interestingly, I don't get an exception either which seems very strange. I have caching disabled, and I have tried clearing the cache anyway but still no change.
Very strange!!
All the best
David
Many thanks for getting back to me, I did try that before hand as I found it in some documentation somewhere with 3 available values; boostrap3, false and I can't remember the last one if I am honest, and I can't find the documentation now unfortunately, when putting them in though, I still don't see the layouts.
Interestingly, I don't get an exception either which seems very strange. I have caching disabled, and I have tried clearing the cache anyway but still no change.
Very strange!!
All the best
David
@bvcreative
If you ZIP your theme and attach it as a reply, I can take a look at it.
If you ZIP your theme and attach it as a reply, I can take a look at it.
Hi MrKDilkington
Thank you very much for your generous offer. Sorry for the delay, we have been stacked and I needed to strip some stuff out of it before I could send it.
Attached is a very stripped back version of it but it still includes all the core back end code which should be required.
Any advice you could give would be greatly appreciated.
Many thanks
David
Thank you very much for your generous offer. Sorry for the delay, we have been stacked and I needed to strip some stuff out of it before I could send it.
Attached is a very stripped back version of it but it still includes all the core back end code which should be required.
Any advice you could give would be greatly appreciated.
Many thanks
David
@bvcreative
When the theme folder name is snake_cased to match the CamelCased namespace name in page_theme.php, the theme installs and the custom layouts work.
I tested this on a 8.0.3 install with sample content. The working version of the theme is attached to this reply.
When the theme folder name is snake_cased to match the CamelCased namespace name in page_theme.php, the theme installs and the custom layouts work.
I tested this on a 8.0.3 install with sample content. The working version of the theme is attached to this reply.
Hi MrKDilkington
Aaaaah school boy error, I can't believe I missed that!! Thank you very much for your help, much appreciated.
For anyone else that comes across this thread, my issue was that my theme was named like:
It should of been:
If you don't mind me asking, would you mind removing the attachment? I thought I had removed all of the client sensitive data from it but I missed something so I would rather it not be available for download.
Many thanks
David
Aaaaah school boy error, I can't believe I missed that!! Thank you very much for your help, much appreciated.
For anyone else that comes across this thread, my issue was that my theme was named like:
my-theme
It should of been:
my_theme
If you don't mind me asking, would you mind removing the attachment? I thought I had removed all of the client sensitive data from it but I missed something so I would rather it not be available for download.
Many thanks
David
I'm in a similar position. I copied the Elemental theme into application/themes/myTheme and enabled it. When I load a page, content that was in multiple columns is now in one column and I get an error message about no grid framework installed. In my page_theme.php it clearly states that
Also the H1, H2, and H3 definitions are different. I'll try searching for a log file to see if I can learn any more.
protected $pThemeGridFrameworkHandle = 'bootstrap3';
Also the H1, H2, and H3 definitions are different. I'll try searching for a log file to see if I can learn any more.
I think you also need to change some namespaces or something:
https://documentation.concrete5.org/tutorials/how-to-copy-the-elemen...
It might be best to change the name of the copied theme too, lest there be confusion.
You could install Cloneamental, which has already done this for you.
https://documentation.concrete5.org/tutorials/how-to-copy-the-elemen...
It might be best to change the name of the copied theme too, lest there be confusion.
You could install Cloneamental, which has already done this for you.
Hey that worked. My problem was that I named my theme directory with a capital letter in it. Next time I'll use cloneamental. Now I'm off to the races! Thank you very much!
I copy and pasted your page_theme.php code into the page_theme.php (the namespace was changed) of a theme I had installed and active in v8.0.3.
It threw an error:
I then added a $pThemeGridFrameworkHandle value for a valid grid framework and was then able to continue without errors.
I believe you may need to declare a valid $pThemeGridFrameworkHandle to use the custom layout presets.