Hi,
I would like to create a plugin that extends the "Default Theme" and not the "BasicTheme".
I'm following the "Create a Theme" tutorial (on atlassian.com) but all the examples are for extending the "BasicTheme" but this theme doesnt have the advance layouts like the "Defaul Theme" does.
Is this possible to achieve or I have to recreate the whole "Default Theme"?
All I want is to include a unique css file to restyle the content editing of theme theme in tinymce and globaly in some areas, the plugin Theme creation tutorial allows us to achieve what we want but we loose the default themes lyout features.
Community moderators have prevented the ability to post new answers.
Hey Alex, one way to achive the default layout paring with your own styles would be to use fetch the default layout vmd files here: http://localhost:1990/confluence/admin/listdecorators.action
and add them to your theme like so:
<theme> ... <layout key="${project.groupId}.${project.artifactId}:main"/> <layout key="${project.groupId}.${project.artifactId}:global"/> <layout key="${project.groupId}.${project.artifactId}:page"/> ... </theme>
<layout key="main" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/main.vmd"> <resource type="velocity" name="decorator" location="/layouts/main.vmd" /> </layout> <layout key="global" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/global.vmd"> <resource type="velocity" name="decorator" location="/layouts/global.vmd" /> </layout> <layout key="page" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/page.vmd"> <resource type="velocity" name="decorator" location="/layouts/page.vmd" /> </layout> <layout key="space" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/space.vmd"> <resource type="velocity" name="decorator" location="/layouts/space.vmd" /> </layout>
You will have to override the hasSpaceSideBar() function in several of the layout files.
Hi @DiscountrobotI tried adding the layout tags to the theme and looked at the suggested URL but I still get the message "You can not customise the site look and feel while a theme is active. You must first disable the currently configured theme." when I navigate to that URL.
I added the main.vmd file to project/src/main/resources/main.vmd
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@DiscountrobotI didnt notice the update you've done let me try that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to disable the current theme to see the default layout files.
What you're trying to do could essentially be achived by adding styles in the Look & Feel section and customising the default layout files
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@DiscountrobotI tried out the layout attributes that you just recently posted and now the theme is not appearing in the Themes section. i tried the exact example you posted (but just using main.vmd) and changed to BasicTheme as well which gives the same result:
<theme key="simpletheme" name="Simple Theme" class="com.atlassian.confluence.themes.BasicTheme"> <description>A simple custom theme</description> <param name="includeClassicStyles" value="false"/> <resource type="download" name="default-theme.css" location="/includes/css/default-theme.css"> <param name="source" value="webContext"/> </resource> <resource type="download" name="theme-tutorial.css" location="/css/theme-tutorial.css"/> <layout key="main" name="Main Decorator" class="com.atlassian.confluence.themes.BasicTheme" overrides="/decorators/main.vmd"> <resource type="simpletheme" name="decorator" location="/layouts/main.vmd" /> </layout> </theme>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My mistake, the tinyMCE editor is crap here.
You have to define the overrides outside of the theme declaration and then reference them by the key
<theme> ... <layout key="${project.groupId}.${project.artifactId}:main"/> <layout key="${project.groupId}.${project.artifactId}:global"/> <layout key="${project.groupId}.${project.artifactId}:page"/> ... </theme> ... <layout key="main" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/main.vmd"> <resource type="velocity" name="decorator" location="/layouts/main.vmd" /> </layout> <layout key="global" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/global.vmd"> <resource type="velocity" name="decorator" location="/layouts/global.vmd" /> </layout> <layout key="page" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/page.vmd"> <resource type="velocity" name="decorator" location="/layouts/page.vmd" /> </layout> <layout key="space" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/space.vmd"> <resource type="velocity" name="decorator" location="/layouts/space.vmd" /> </layout>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, I tried to follow the steps you described:
then added:
<theme> ... <layout key="${project.groupId}.${project.artifactId}:main"/> <layout key="${project.groupId}.${project.artifactId}:global"/> <layout key="${project.groupId}.${project.artifactId}:page"/> <layout key="${project.groupId}.${project.artifactId}:space"/> </theme> <layout key="main" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/main.vmd"> <resource type="velocity" name="decorator" location="/layouts/main.vmd" /> </layout> <layout key="global" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/global.vmd"> <resource type="velocity" name="decorator" location="/layouts/global.vmd" /> </layout> <layout key="page" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/page.vmd"> <resource type="velocity" name="decorator" location="/layouts/page.vmd" /> </layout> <layout key="space" name="Main Decorator" class="com.atlassian.confluence.themes.VelocityDecorator" overrides="/decorators/space.vmd"> <resource type="velocity" name="decorator" location="/layouts/space.vmd" /> </layout>
Did I understand it correctly or do I need to do anything else?
My problem is that I always get following exception when I try to use my theme plugin:
java.lang.RuntimeException: Error rendering template for decorator root
at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:191)
caused by: java.lang.RuntimeException: Error rendering template for decorator page
at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:191)
caused by: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/com/atlassian/confluence/plugins/labels/components/labels-editor.vm'
at com.atlassian.confluence.util.velocity.ConfigurableResourceManager.loadResource(ConfigurableResourceManager.java:406)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.