TNO Intern

Commit 3fc723bc authored by Arjo Segers's avatar Arjo Segers
Browse files

Expand templates in header and title of index pages.

parent 3769a099
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@
#   Extened option to select range of characters of index value.
#   Option to provide description text under header.
#

# 2025-09, Arjo Segers
#   Expand templates in header and title.
#

# -------------------------------------------------
# help
@@ -744,6 +746,10 @@ class IndexPart(utopya_rc.UtopyaRc):
                continue
            if level_value == "":
                continue
            # replace template?
            if "value" in self.current[level].keys():
                level_value = level_value.replace(f"%{{{level}}}",self.current[level]["value"])
            #endif
            # add link?
            if alinks and ("alink" in self.current[level]) and (level != self.name):
                level_value = '<a href="%s">%s</a>' % (self.current[level]["alink"], level_value)
@@ -844,8 +850,10 @@ class IndexPart(utopya_rc.UtopyaRc):
        if self.filename is not None:
            # show info on creation?
            with_info = self.GetSetting(self.keyname + ".info", totype="bool", default=False)
            # expand title:
            title = self.ReplaceCurrents( self.header )
            # write:
            self.html.Write(self.filename, title=self.header, info=with_info)
            self.html.Write(self.filename, title=title, info=with_info)
        # endif

    # enddef WriteFile