Wednesday, September 26, 2007

Advanced Use of Lists - Sub-Lists / Under-Lists Creation

We already talked about the basic posting of lists in two lessons: How to Create Simple Bulleted Lists & How to Post Advanced Ordered Lists.

Let's talk now about more advanced use of lists in bbCode. You are not limited in posting plain lists, you can combine tags with different option to get some advanced lists with sub-lists under them.

This might be a bit complicated, you may make some errors while creating your list, & may have to preview your messages before you publish them to check if all is correct. All the popular forums allow posts previews, so don't hesitate to use this feature to make sure you're posting a well formated message, or just for testing, why not? ;)

Let's see step by step how to make sub-lists:


As an example, we will create a list with main titles numbered using capital Roman digits, under them, lists with titles numbered using Arabic digits, and finally, a sub-sub-list that is alphabetic with lowercase letters.

Here's what we'll going to get in the end of this tutorial:
  1. American Continent
    1. USA
      1. New York
      2. Los Angeles
      3. Miami
    2. Mexico
  2. Africa
    1. Egypt
    2. Algeria
    3. Sudan
  3. Europe
    1. Spain
    2. Switzerland

As we saw, unless with Simple Machines Lists, all others are made using two tags: the [list] tag & the [*] tag, let's first type the code for our main list containing continents, we will use the I option for it:

[list=I]
[*]American Continent
[*]Africa
[*]Europe
[/list]

Result:
  1. American Continent
  2. Africa
  3. Europe
Nothing we don't already know till now, now, let's insert the code for the sub-lists of countries, there are countries under each continent, so we are going to add an under-list under each continent name, using the option 1 this time:

[list=I]
[*]American Continent
[list=1]
[*]USA
[*]Mexico
[/list]
[*]Africa
[list=1]
[*]Egypt
[*]Algeria
[*]Sudan
[/list]
[*]Europe
[list=1]
[*]Spain
[*]Switzerland
[/list]
[/list]

Notice how the first & second lists we added, had their starting tag [list] inserted just after the continent name it should be under, and their end tag [/list] put just before the next continent.

For the list under Europe, and as it's the last one, the end tag was inserted before the end tag of the main list of continents.

Result:
  1. American Continent
    1. USA
    2. Mexico
  2. Africa
    1. Egypt
    2. Algeria
    3. Sudan
  3. Europe
    1. Spain
    2. Switzerland
Now, under USA, we have a list of cities ordered alphabetical, for that, we have to insert cities list with the option a (for lower-case letters), under the list of American countries, exactly between the [*]USA code & the [*]Mexico code:

[list=I]
[*]American Continent
[list=1]
[*]USA
[list=a]
[*]New York
[*]Los Angeles
[*]Miami
[/list]
[*]Mexico
[/list]
[*]Africa
[list=1]
[*]Egypt
[*]Algeria
[*]Sudan
[/list]
[*]Europe
[list=1]
[*]Spain
[*]Switzerland
[/list]
[/list]

We already saw the result, this:
  1. American Continent
    1. USA
      1. New York
      2. Los Angeles
      3. Miami
    2. Mexico
  2. Africa
    1. Egypt
    2. Algeria
    3. Sudan
  3. Europe
    1. Spain
    2. Switzerland


Any questions? As always, drop a comment! :)

1 comment:

forsan.elkhaleg said...

انتم تستحقوا العيش في منزل نظيف وخالي من اي اتربة ولكن كيف ستحقوا هذا الحلم مع شركة تنظيف بيوت بالمدينة المنورة هذا الحلم سيتحقق وبصورة لم تتخيلوها فقط تواصلوا معانا عبر
http://www.forsan-elkhaleg.com