Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Modifying themes with Sweaver

From: Drupal 7 Advanced Training

Video: Modifying themes with Sweaver

lynda.com has a terrific course about traditional theming. It's a deep technical course, and that's because it had to be. Until recently, the only way to modify themes was by changing PHP and CSS code, line by line. But now there are a few graphical tools for editing the CSS. I covered one of them in depth for the Drupal Gardens Essential Training Course. Definitely check that out to learn how to make exportable theme using the Drupal Gardens Theme Builder. But there are also two other Graphical Theme Editors that are available as Standard Drupal Modules to install on your own site, the first one is Sweaver, which I'll cover in this video and the other is Livethemer.

Modifying themes with Sweaver

lynda.com has a terrific course about traditional theming. It's a deep technical course, and that's because it had to be. Until recently, the only way to modify themes was by changing PHP and CSS code, line by line. But now there are a few graphical tools for editing the CSS. I covered one of them in depth for the Drupal Gardens Essential Training Course. Definitely check that out to learn how to make exportable theme using the Drupal Gardens Theme Builder. But there are also two other Graphical Theme Editors that are available as Standard Drupal Modules to install on your own site, the first one is Sweaver, which I'll cover in this video and the other is Livethemer.

Here we go with Sweaver. First to we get the module from drupal.org/project/sweaver. You'll notice that it requires Chaos Tools, which we already installed and jQuery UI, but that's already built into Drupal 7. So we copy it and install as usual, and paste it in. Scroll down.

Now let's go back to our home page where you'll see something quite different, this is a Sweaver palette down here. You see how it works quite simply. Go around the page, point and click at any part of it. Like let's say this text right here. Immediately you'll get ways to change the appearance of that text. You can change its background, its borders and spacing, and so forth. I am going to show something a little bit more complicated. This is an h2 right here, but you'll noticed that there are other h2s on the page. So it selects all of them. You could change the font, and as you expect, it changes all of them.

But what if you only wanted to change one of them? Well, then go up to the full path here and you could select or deselect these. Like let say we only want the one that goes with node-8, we check that then we'll make more changes. Let's make it a little bit bigger than all the others. As we scroll down, we see, yeah, it only affected that one. As with anything in CSS this can be the tricky part figuring out exactly what it is you're going to affect, but Sweaver makes it much, much easier than if you're playing around with CSS text files.

You can do other things besides change the font. You can get a Background or change the Spaces around it, so I'll just write it out. Or pretty much anything else you would do with CSS. When you're done making your changes, you click Save, then you name the style. When I do this, I usually save it with a name that includes the theme I am using. In this case Bartik. I can Save and continue or Save and publish, which actually makes this a live site.

We can check that of course by going to another browser and loading it up. Yup, and there is our change. Now you might be asking yourself, where do these changes actually gets saved? I'll show you that by going into my Terminal program. I am already at the doc root for this site. Now normally if you change the theme, it's is going to go into sites/all/themes. When I take a look at what's in that directory, you'll notice that there isn't anything actually that is related to Sweaver. Instead, the changes that Sweaver makes get saved in your files directory.

So we go into default/files and you'll notice that there is now a directory called sweaver, and there it is. There is the draft version that we had and a live version. So far, so good. Now we're going to go down into the rabbit hole, because you see, the options that I showed you so far are only a small percentage of what's available. I'll go back and show you what I mean. Obviously there are all the other things you can do with the Font, and the Background and Borders and Spacing.

This other tab is still empty, but that's going to change in a minute. To expose all of its power, we go up to Configuration, then down to Sweaver, which is under User Interface. This page has five tabs and I'll go through them very quickly, because as you'll see, there are lots of options. This first one allows you to Exclude paths. By default excludes some of the more commonsense ones. For example, when we're on an administration page, like the one we're on right now, we don't want that Sweaver palette popping up in front of us. It's also set up by default, so that when you point at the Sweaver palette itself, it doesn't bring up the Sweaver controls; that would be sort of redundant and you'd end up in this infinite loop sort of.

And then there are some other geeky things down here. If you don't know what they mean, don't worry about them. Now let's continue on. You can change the order in which all of the options appear in the Sweawer palette -- that's not just for the Form; it's also Selectors and Properties and so forth. And you can add additional capabilities to Sweaver. For example, let's add this Palettes and Switch Theme options and Save configuration. Then let's go back and take a look and watch what happens to the palette when we do.

See, we now have a Switch theme tab, and as we go through, we see that other things have changed as well. Moving on, let's go back and configure our Sweaver screen again. After you've built up a library of styles, you can save them here and then there are some additional options. For example, if you want to be able to delete them from the Sweaver interface, you just click the Show delete Tab, and finally, some controls having to do with images. Now let's get back to how Sweaver actually does all of this.

There is one potential problem, which is that the changes you make don't actually become part of the theme. They're in that Sweaver folder I showed you earlier with your site files. Sweaver then knows to look where it is and render your theme to the screen. That means you can't actually hand this theme off to someone else, unless they're also running the Sweaver module. One good thing though is, you can take a look at the CSS and use that in your local.css file. Let's take a look, for example, at what we changed so far. Yup, it's just ordinary CSS, copy it and paste it, then you can turn off Sweaver.

In this way, I think that Sweaver's method of saving files is actually a benefit; because the way Sweaver delivers both ease of use for beginners and a finesse solution for experts is really handy. Now the last thing I'm going to do before we go is to turn off Sweaver, because obviously to continue with the course and when you're launching a site, you don't want this popping up in front of people after you finished designing your site. So I'll close this out, go up to Modules, all the way down to Sweaver, Save configuration, and when we close out this overlay, we see that the site is back the way we wanted it.

Show transcript

This video is part of

Image for Drupal 7 Advanced Training
Drupal 7 Advanced Training

72 video lessons · 10890 viewers

Tom Geller
Author

 
Expand all | Collapse all
  1. 4m 51s
    1. Welcome
      1m 7s
    2. Planning your Drupal career
      3m 44s
  2. 25m 46s
    1. Comparing development and production environments
      6m 22s
    2. Configuring your settings.php file
      7m 10s
    3. Running multiple sites from one Drupal installation
      7m 32s
    4. Troubleshooting common issues
      4m 42s
  3. 51m 20s
    1. Understanding your Drupal site's place on the web
      2m 44s
    2. Selecting a web host
      7m 20s
    3. Using Unix's command-line interface
      8m 23s
    4. Working with your web host's access restrictions
      4m 51s
    5. Using cPanel and other graphical web host interfaces
      3m 40s
    6. Transferring files to and from your web host
      5m 49s
    7. Moving databases using phpMyAdmin
      6m 34s
    8. Moving databases using Unix commands
      6m 8s
    9. Modifying server configuration files
      5m 51s
  4. 27m 10s
    1. Learning from case studies
      3m 13s
    2. Planning your site
      4m 18s
    3. Populating your site with Devel Generate
      3m 42s
    4. Managing URL paths
      3m 20s
    5. Restricting access to downloadable files
      5m 55s
    6. Reusing site components with the Features module
      6m 42s
  5. 21m 53s
    1. Understanding and installing Drush
      5m 23s
    2. Installing Drupal using Drush
      7m 24s
    3. Building a site using Drush
      9m 6s
  6. 31m 59s
    1. Backing up with the Backup and Migrate module
      8m 17s
    2. Moderating comment spam
      6m 47s
    3. Migrating from Drupal 6
      4m 28s
    4. Migrating to Drupal 7
      12m 27s
  7. 22m 24s
    1. Letting users log in through OpenID
      5m 10s
    2. Letting users log in through Facebook, Twitter, and other services
      9m 43s
    3. Republishing posts on Facebook and Twitter
      7m 31s
  8. 1h 5m
    1. Understanding Drupal's base themes
      5m 55s
    2. Introducing base themes: Zen and subtheming
      11m 35s
    3. Introducing base themes: Fusion and extensibility
      10m 44s
    4. Introducing base themes: AdaptiveTheme and responsive design
      7m 25s
    5. Introducing base themes: Omega and mobile devices
      7m 9s
    6. Using Firebug and other theming tools
      7m 20s
    7. Modifying themes with Sweaver
      6m 59s
    8. Modifying themes with Livethemer
      8m 45s
  9. 49m 35s
    1. Understanding the Rules module
      6m 48s
    2. Demonstrating how Rules works in Drupal Commerce
      3m 53s
    3. Creating practical rules
      6m 37s
    4. Improving rules
      9m 10s
    5. Defining conditions with the Context module
      7m 51s
    6. Varying layout with the Context and Delta modules
      5m 0s
    7. Varying layout with the Panels module
      10m 16s
  10. 52m 46s
    1. Enabling social features
      9m 46s
    2. Implementing a voting system
      9m 15s
    3. Rewarding good behavior with the Userpoints module
      5m 57s
    4. Setting up Organic Groups
      6m 28s
    5. Adding content to groups
      2m 21s
    6. Seeing group activity better with views and panels
      10m 13s
    7. Making groups private
      4m 54s
    8. Letting each group have its own permissions
      3m 52s
  11. 25m 32s
    1. Understanding packaged Drupal distributions
      2m 8s
    2. Getting a head start with Acquia Drupal
      7m 28s
    3. Creating online storefronts with Drupal Commerce
      6m 53s
    4. Creating government web sites with OpenPublic
      9m 3s
  12. 1h 30m
    1. Taking the assignment
      3m 26s
    2. Planning the project
      3m 43s
    3. Preparing the infrastructure
      8m 42s
    4. Starting the design
      7m 35s
    5. Filling in the content
      7m 29s
    6. Developing the layout
      10m 27s
    7. Finishing the layout
      7m 8s
    8. Refining the CSS
      6m 32s
    9. Setting up sections for regional offices
      4m 53s
    10. Configuring regional offices
      7m 18s
    11. Connecting to social media
      5m 9s
    12. Cleaning up
      12m 32s
    13. Securing the site
      5m 56s
  13. 37s
    1. Next steps
      37s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Drupal 7 Advanced Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.