2

I'm contributing to the Radix theme in D7 for panopoly, which uses Twitter Bootstrap.

I'm seeking out ways to implement as many of twitter bootstrap's awesome capabilities as possible, and thus not have to rely on overriding theme css, and to make it work 'natively' and rely on cleaner CSS.

So, the 'unstlyed' list property in Twitter Bootstrap is a perfect example of this.

<ul class="unstyled">
  <li>...</li>
</ul>

However, I can't figure out how I would add this class to the views unformatted style by default using the theme. Is this possible with template files, template.php code or an include file? I would prefer to do this within the radix theme. Help!

  • views-view-list.tpl.php would be the tpl file for views lists (grab from views theme and add to the radix templates view folder), but you would have an all or nothing modification if you went this route as you'd hard code in the class. – pokermoneyclips Jan 3 '14 at 18:09
2

You could use the rewrite option in views to get the exact html output you need. Rewrite enables you to override the output of this field with custom text or replacement tokens. I use the last field, since the replacement tokens should be above the field you are rewriting. Make sure to go through set the field, label, wrapper html to None

In Views

  1. Click on a Field
  2. Click on Rewrite the output of this field
  3. Add your code with the desired html output

Code

<ul class="unstyled">
  <li>[field_degree]</li>
  <li>[field_major] </li>
</ul>

Output

<span class="field-item">
 <ul class="unstyled">
   <li>Certificate</li>
   <li>Supervision </li>
 </ul>
</span>

OR you can

  1. Click Advanced
  2. Click CSS class
  3. Add the name of your class "unstyled" to the entire view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.