# Following on from Adding Unique Class Names

**URL:** <https://meta.discourse.org/t/following-on-from-adding-unique-class-names/37881>\
**Category:** Feature\
**Created:** [2016 年1 月 13 日 11:18 UTC](https://meta.discourse.org/t/following-on-from-adding-unique-class-names/37881 "2016-01-13T11:18:10Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

作者： ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
发布日期： [2016 年1 月 14 日 19:49 UTC](https://meta.discourse.org/t/following-on-from-adding-unique-class-names/37881/13 "2016-01-14T19:49:02Z")

</div>

For the category list I would recommend using ID’s they don’t change over time and are fixed at the point of creation.

I manage several Discourse instances with 50+ categories for 2 of the instances and when it get’s to this high a number ID’s are the way to go.

Now sometimes you need visibility to those ID’s as a developer for a short while to setup the CSS and other customisations - if for you using Dev Tools is an issue then you can expose the ID’s via `CSS and HTML Customizations` added to `</body>` like this one:

```HTML
<script>
if (window.jQuery) {
    window.jQuery(function ($) {
        var PageTracker = require('discourse/lib/page-tracker').default,
            updateCategory = function () {
                $('.categories .category h3').each(function( index ) {
                    var h = $( this );
                    h.append( ' - ' + h.parent().closest('tr').data('category_id') );
                });  
            };
        PageTracker.current().on('change', function (url) {
            setTimeout(function () {
                updateCategory();
            }, 100);
        });

    });
}
</script>

```

You can see a screen grab of the kind of output here:

 ![](https://global.discourse-cdn.com/meta/original/3X/1/1/11650624d4e507bd734e9243420349d2613eca34.png)

After you are done with your CSS customisations I would recommend then turning this customisation off.

---

_[View the full topic](https://meta.discourse.org/t/following-on-from-adding-unique-class-names/37881)._
