in SpringSource Tool Suite, where can I edit the themes? - css

I've been asked to theme a site for a team (just a few hours they said), but they're using Grails with SpringSource tool Suite. I'm not familiar with either.
When I look at the "proper" source, the theme source files don't exist, yet they get served. If I search for the files in the IDE, I get some stuff in .path_to_grails_plugin directory (which is not in source control). If I edit THERE, it picks up my changes, but that doesn't help the team... and I want to point to a NEW theme, not mess up the original one. The Target directory has some of the files, but not all, but isn't that where generated content goes? So where is the REAL source? This feels like the dark arts to me. I am clearly missing some fundamental knowledge about how this works.
I want to add a custom theme (theme-roller-generated), so I created a sub-folder for it in my web-app folder. Then, in my config.groovy file I put:
grails.resources.modules = {
core {
dependsOn 'jquery-ui'
}
// Define reference to custom jQuery UI theme
overrides {
'jquery-theme' {
resource id: 'theme', url: '/css/theme-redo/jquery-ui-1.8.19.custom.css'
}
}
}
That doesn't do anything. It still serves the old css. Help me find the light!

The CSS is stored in the web-app\css and the JavaScript is in the web-app\js directories. However, I high recommend going through some tutorials before moving stuff around by trial and error. Good luck!

I've been running into the same problem. My workaround is to create another Resource module and include the theme there. It's an imperfect solution as the original unwanted theme css is still included - but it works.
ApplicationResources.groovy contains:
modules = {
application {
resource url:'js/application.js'
resource url:'/css/smoothness/jquery-ui-1.8.20.custom.css'
}
}
my.gsp contains:
<r:require modules="jquery, jquery-ui, application" />
ordering may be important..

Related

Shopware CSS(LESS)

I have a small problem with Shopware aplication. My point is, I create a new Theme which works perfectly, I can change any information at webpage using shopware backend profile, but when i copy the less files to my new repository folder, I cannot compile new theme. It stucks.
From the beginning,
Creating a theme using parent Responsive, all works perfect, theme compile.
Changing information on page, work perfect, theme compile.
Copy less files from Responsive/_public/less to newrepository/frontend/_public/less etc and it stucks.
Right now i dont have any idea how I am suppose to deal with it.
Any ideas ?
When a theme in shopware doesn't compile there is most probably something wrong with your less files. Have you copied all less files?
The path you mentioned is not correct.
syntax error in less files?
Did you copy the file Responsive/frontend/_public/src/less/all.less without copying the files that are imported in the all.less? Same applies for other files in this directory.
Whatever it is that is wrong with your less files. You shouldn't need to copy them from the parent theme. If you want to change something, just create your own files.
Say you want to have the background white. Create a file YOUR_THEME/frontend/_public/src/less/_modules/body.less with the content:
body {
background: #fff;
}
Then you are also going to need a file YOUR_THEME/frontend/_public/src/less/all.less with the content:
#import "_modules/body";
No need to copy or modify the original files.
Create a .css file here:
Responsive/frontend/_public/src/css/style.css
After that you should include the file in your Theme.php file like this:
protected $css = array('src/css/style.css');
under this function:
public function createConfig(Form\Container\TabContainer $container)
{
}
It worked for me. I have no idea how to include less files in a theme, they are usually added in a plugin by creating an event. I hope this helps.
Also Responsive Theme is default theme in Shopware. You should extend it and work on the newly created theme.
I guess it is obviously but are you following the Shopware strukture?
all.less (#import "modules";)
--_modules (#import "_modules/your";)
---your.less
?
Please don't copy all Less Files from the responsive theme. There are some mixins for the grid that stucks if you compile it twice, which is exactly the case if you copy all the files.

Adding functionality to a wordpress plugin

This is a simple concept question... If I have a wordpress plugin and I want to write some functions for my own IN ADDITION to what they have already where would I put them in the wordpress file structure?
I cant put them in the original core.php files/directory because they will get wiped out when the plugins are updated right?
#NomikOS - Yeah Sure .. I have a wordpress plugin called BP-Phototag- pretty much an album..Its located in the wp-content/plugins folder. I want to add my own functions...for a specific template in my themes folder. DO i put the functions in the bpa.core.php file in the wp-conten/plugins folder or do I make a new php file that can inherit bpa.core.php functions(which I dont know how to do) and stick them in my template specific folder under wp-content/themes/mytheme folder. Im really not sure how to extend and override it...
If the plugin is class based, you can extend it to override/add methods. You can include the file containing your code inside plugin's directory if you want (it will not deleted after an upgrade) or directly inside plugins dir.
EDIT 1
Sorry, I didn't saw your last comment. Well, my friend, it's time to learn OOP PHP5. I recommend you PHP 5 objects, patterns, and practice. It's for PHP serious coders.
Basically you do
class leon_my_class extends BP_Phototag_class {
function __construct()
{
parent::__construct();
// my code
}
// overriding protected/public method
function BP_Phototag_method()
{
// this code will replace original code
}
// adding method
function my_own_method()
{
}
}

Language independant themable CSS in Sharepoint

After a little research it turns out that themable custom css in sharepoint should be placed either in the styles library or in the layouts folder but always in a language dependant folder structure like /<LCID>/Styles/Themable
I would like to replace the target folder of the css files in the package with the primary language of the server where the solution is deployed.
For Example, I want to change
<TemplateFile Location="Layouts\1031\Styles\mygrid.css" /> to
<TemplateFile Location="Layouts\1033\Styles\mygrid.css" /> when the solution is deployed.
A solution to this problem would also help for other files which have to be put in the Layouts\LCID directory such as theme xmls themselves.
Thanks for your help!
I understand you have only one version of css file (language independent) and you need to put it into the right folder during deployment.
The solution can be to get rid of the language specific folder schema and put your css file into Layouts\YourProject folder and then register the css file via CssRegistration control on your master page, web part or control.
See also my related question.

Custom Drupal theme template files not being used

I am trying to organize my theme folder, which has node theming overrides for dozens of views. Basically I have two different styles and I want them all to look the same, more or less.
Is there a way in template.php that I can do this? And what is the best way?
I tried this code in my theme's hook_preprocess_node function:
switch($vars['view']->name) {
case 'taxonomy_term' :
switch($vars['view']->current_display) {
case 'page' :
array_push($vars['template_files'], 'list-view');
default :
break;
}
break;
default :
break;
}
And when I look in theme developer, I can see the list-view.tpl.php file there, but its not actually using that file from my theme directory. What am I missing?
As you can see in theme() Drupal will only actually use a template if it exists according to drupal_discover_template().
You should try to figure out if that is the case.
place some debug code in the theme() function in includes/theme.inc to see what drupal_discover_template() returns for vairious template calls.
Can it find it?
If not:
place some debug code in drupal_discover_template() to find out where Drupal thinks it no longer is a template.
My gut-feeling says that it is due to subdirectories where the template files reside, but which you have not added to the template_files variable: views/lists/some_list.tpl.php is not the same as some_list.tpl.php.
You need to rebuild the cache for the tpl.php file to be picked up.

customising sharepoint site design

My work has recently deployed Sharepoint and I'm currently trying to get to grips with it.
I'd like to be able to completely customise the way my blog looks but I have no idea where to start. I had a look through Microsoft's developer site and it does look like they have a lot of stuff there but it all seems to be pitched at a much higher level than I'm at.
I'd consider myself pretty experienced with CSS and web development, does any of this translate into sharepoint? Can I make a new CSS file and upload a bunch of images into a store and change the look of my 'site' that way, or is it a lot more complicated?
I realise this is a little vague, but I'd really appreciate some pointers to a "getting started with making sharepoint not look sucky" guide or an example of the sort of thing I can actually hope to achieve. Hopefully my question isn't too high-level.
Thanks
Use SharePoint Themes, their installation is tricky at first but once you get a good development environment you'll be able to test modifications in the traditional "save css file, press F5".
Themes have these pros:
Do not need sharepoint designer
Do not need to change masterpages and deal with (un)ghosting (the sum of all fears)
Can be applied to one subsite and have other subsites with different themes (see gl-applytheme in google for mass application of themes thru many subsites)
and these cons:
You have no access to HTML changes, for that you need masterpage love (I dont think thats a con, its a limitation that usually exists in different scenarios and also makes you improve your css skills so much in the css-zen-garden way)
Themes once applied, go to the server memory -- meaning that if you change your theme folder you need to recycle the application pool, apply a different theme and apply your theme back to see that one pixel border you forgot to put in the footer. But for that specific problem I have a solution below:
After you do your "theme setup" you'll be able to only work with CSS and images and be free to overwrite any class in SharePoint using your favorite Developer Toolbar/Firebug addon to find what you want to change.
In the folder c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES create a folder named THEMEDEV
Inside the new folder, create a file called theme.css and another called THEMEDEV.INF
Inside the .INF file, paste this:
[info]
title=THEMEDEV
codepage=65001
version=3.00
format=3.00
readonly=true
refcount=0
[titles]
1033=THEMEDEV
now open the c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033 folder (1033 is your language code, thats the default for english installations)
edit the SPTHEMES.XML file
below <SPThemes ...> insert:
<Templates>
<TemplateID>THEMEDEV</TemplateID>
<DisplayName>Development Theme</DisplayName>
<Description>Development Theme.</Description>
<Thumbnail>images/thnone.gif</Thumbnail>
<Preview>images/thnone.gif</Preview>
</Templates>
now edit your theme.css file, add an import to your favorite CSS development folder:
#import url('file:///C:/SharepointThemes/Theme1/theme.css');
Save everything, open your sharepoint: Site Actions => Site Settings => Look and Feel => Site theme => choose your Development Theme and hit Apply
If everything worked, you can now edit your C:\SharepointThemes\Theme1\theme.css in your favorite editor, save it with something like
* { color: red !important }
and see the changes on your site.
Something also important when developing themes: do not create folders to store, say, your images, use everything in the same folder and in the code itself use a relative fashion, like background: url('image.png')
ps1: Only you can see changes you are making to your sharepoint site due to the file://c:/ folder, if you need more people to see the changes during development, setup a network path that they all have access, the rest is the same.
ps2: Keep in mind this is a development environment, to make your theme a live theme you need to create another one to store all the content used to change your site's visuals.
The process is similar to the one creating the THEMEDEV one, just put a pretty and consistent name across all configurations (Folder name, .INF name, .INF contents, SPThemes.xml node contents), paste all your images in the Theme's folder and replace the theme.css file with your content.
Edit1: Reading your comment above, now you have a "editing + uploading to FTP" type of setup :) this works for MOSS and WSS by the way (even if you don't know the difference). For more info on customizing sharepoint, I made a post yesterday about more options:
Sharepoint: How to remove default core.css reference?
I like to always use this post as a starting point for SP branding: http://erikswenson.blogspot.com/2008/10/functional-sharepoint-branding-style.html
It depends on whether you're talking about a WSS 3.0 site or a MOSS site. WSS 3.0 sites can be customized using themes. Customizing MOSS sites is a little trickier, although you can add a SINGLE custom CSS style sheet via Central Admin - in this case, your custom files, images, etc., would be deployed as a Feature.
The best explanation of how this works that I have come across is the six part series on the cleverworkarounds.com site.

Resources