howto_user (howto_user) wrote in s2howto,

[paidaccount][asg] Adding a tag list to the sidebar

Paid Accounts Only
The following tutorial requires creating and editing a custom style, which in turn requires a paid, permanent, or early adopter account. Please read What are the paid account benefits? and How do I buy a paid account? to learn about the paid account benefits and how to buy a paid account.

This tutorial will explain how to add a tags list to the sidebar in A Sturdy Gesture. It will override the function Page::lay_navbar. This new code will be placed in a theme layer. If you already have a theme layer, you will need to edit it and add the code below. If you do not have a theme layer, you will need to create one by following the instructions in the Theme Layer tutorial.

In the A Sturdy Gesture layout, you can add add a list of your tags in an extra sidebar box, using the code below. Note that if your theme layer already has function Page::lay_navbar, you will need to modify it to include the code highlighted in orange. Otherwise, copy and paste the following code into the layer, making sure to include everything:

function Page::lay_navbar() {
    var string userpic;
    var Image up_img = $.journal.default_pic;
    if (defined $up_img) {
        $userpic = """<div class="userpic">
<img src="$up_img.url"
     class="userpic" alt=""
     height="$up_img.height" width="$up_img.width" />
    var string website;
    if ($.journal.website_url != "") {
        $website = """<li><a href="$.journal.website_url">


<td id="navbar" width="25%">
<div class="box">
    foreach var string v ($.views_order) {
        if ($.view == $v) {
            println "<li class=\"active\">"+lang_viewname($v)+"</li>";
        } else {
            println "<li><a href=\""+$.view_url{$v}+"\">"


    if ($this->lay_show_firstnav()) {

    if (size $this.linklist > 0 and $*linklist_support) {
        println "<div class=\"box\">";
        println "<h2>Links</h2>\n";
        println "</div>";

var TagDetail[] visibletags = $this->visible_tag_list(); if (size($visibletags) != 0 and $this.view != "friends") { println "<div class=\"box\">"; println "<h2>Tags</h2>\n<ul>"; foreach var TagDetail td ($visibletags) { """<li><a href="$td.url">$</a></li>\n"""; } println "</ul>"; }
"</td>"; }

This code will add a tag list to the sidebar in all journal views except the friends view. If you would like to see your tag list also on your friends page, remove the text highlighted in yellow.

Compile your layer, and it's ready to use. You will need to apply your theme layer via the Customize interface in order for your changes to take effect.

Compiled by tell_me. Based on a tutorial contributed by camomiletea.

Tags: - a sturdy gesture, paid accounts only, tag list

Comments for this post were disabled by the author