Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-07-13 18:12:50

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

[textile] Can Textile add a class to <ul> by default?

Hi,

I’m using a CSS framework (OOCSS) in which lists need a “simpleList” class in order to have bullets.

Is there a way to make Textile add it by default? I looked in /textpattern/lib/classTextile.php but I couldn’t orient myself.

Thanks!

Offline

#2 2010-07-13 18:19:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,293
Website GitHub

Re: [textile] Can Textile add a class to <ul> by default?

neomatrix wrote:

lists need a “simpleList” class in order to have bullets.

You should be able to do this, unless I’ve misunderstood your question:

*(simpleList) Item 1
* Item 2
...

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2010-07-13 18:29:50

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

Re: [textile] Can Textile add a class to <ul> by default?

Thanks, but actually I was looking for a way to make every <ul> automatically become <ul class=“simpleList”>. Do you thin it possible?

Offline

#4 2010-07-13 19:49:30

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [textile] Can Textile add a class to <ul> by default?

Offline

#5 2010-07-13 19:49:43

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: [textile] Can Textile add a class to <ul> by default?

neomatrix wrote:

Thanks, but actually I was looking for a way to make every <ul> automatically become <ul class=“simpleList”>. Do you thin it possible?

There is no auto-adding classes in textile – and this is normal. You could use javascript (jquery) to preform auto-adding class:

<script type='text/javascript'>
  $(document).ready(function(){
    $("div.container ul").addClass('myclass'); // add "myclass" to ALL ul's inside <div class="contaner">
  });
</script>

Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#6 2010-07-13 19:54:05

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

Re: [textile] Can Textile add a class to <ul> by default?

OK, thanks, jQuery is a solution.

Offline

Board footer

Powered by FluxBB