Difference between revisions of "S2 Cookbook: Linking the title on your journal to your main journal page"

From Dreamwidth Notes
Jump to: navigation, search
(Created page with 'Here is a theme layer that will add link the journal's title to the main journal page. These functions could also be used in a layout layer. If you are using this with another …')
 
m
Line 12: Line 12:
 
     }
 
     }
 
}
 
}
 +
 
function FriendsPage::print_global_title() {
 
function FriendsPage::print_global_title() {
 
      
 
      

Revision as of 21:49, 10 July 2010

Here is a theme layer that will add link the journal's title to the main journal page. These functions could also be used in a layout layer. If you are using this with another layout's theme, copy the theme layer code from the public layer list and add the functions onto the end.

layerinfo "type" = "theme";
layerinfo "name" = "Linked Titles";
layerinfo "is_public"       = 1;
layerinfo "source_viewable" = 1;
 
function Page::print_global_title() {
    if ($.global_title) {
        """<h1 id="title"><a href="$.base_url"><span>""" + $.global_title + """</span></a></h1>""";
    }
}
 
function FriendsPage::print_global_title() {
 
    """<h1 id="title"><a href="$.base_url"><span>""";		
    if ($.friends_title) {
        $.friends_title;
    }
    else {
        $.global_title;
    }
    """</span></a></h1>""";
}