GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 

GenoPro Support Forum




Sources/Citations tweak

Click to view RSS...
Author Improvements in the report to display sources & citations
Posted Wednesday, June 8, 2011 - Post #28514
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 9:23 PM
Posts: 3,464, Visits: 26,854
Mashed this into the mix for version 2011.06.08


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Posted Friday, June 3, 2011 - Post #28482
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

FamilyTrees.GenoPro.com
Customers
GenoPro version: 3.1.0.1

Last Login: Thursday, June 2, 2022
Posts: 108, Visits: 1,280
So I think a solution might look like this ...

"mash" crept in because it is on the menu for tea - that's "dinner" to anyone from outside yorkshire Wink - just as soon as I peel myself away from the PC

I'm sure you'll think of something more appropriate than "mash"

' Write all the footnotes to the report
Sub WriteHtmlAllFootnotes(oSources, mash)
  Dim collSources
  Set collSources = Util.NewGenoCollection()
  If Not Util.IsNothing(OSources) Then collSources.Add(oSources.ToGenoCollection)
  If (g_collFootnotes.Count > 0) Or (collSources.Count > 0) Then
      If Session("NestSourceRefs") Then
    If mash then
        Report.WriteLn "<div class='clearleft'><ul class='xT note'>"
        Report.WriteFormattedLn "  <li class='xT-o xT-h' onclick='xTclk(event,"""")'>Source", Dic.Plurial("SourceCitation", 1)
        Report.WriteLn "    <ul class='xT-n'>"
        Report.WriteLn "     <li class='xT-b xT-n'>"
    Else
          Report.WriteLn "<div class='clearleft'><ul class='xT'>"
          Report.WriteFormattedLn "    <li class='xT2-{} xT-h' onclick='xTclk(event,""2"")'>", Util.IfElse(g_fCollapseReferences, "c", "o")
          Report.WriteFormattedLn "<a name='SourcesCitations'></a><h3 class='xT-i inline'>{&t}</h3><ul class='xT-h'><li>", Dic.Plurial("SourceCitation", 2)
      Report.WriteLn "<div class='footnote clearleft'>"
    End if
      Else   
    Report.WriteLn "<div class='footnote clearleft'>"   
      End If
     
          If (g_collFootnotes.Count > 0) Then
              Dim iFootnote, oFootnote, strTitle, strSep, s
              iFootnote = 0
              For Each oFootnote In g_collFootnotes
                  iFootnote = iFootnote + 1
                  strTitle = StrPlainText(oFootnote, Util.FirstNonEmpty(oFootnote.Subtitle, oFootnote.Description, oFootnote.QuotedText, Dic("SourceInformation")))
                  If (strTitle <> "") Then
                      strTitle = Util.FormatString(" title='{}'", strTitle)
                  End If
                  Report.WriteFormattedBr "<sup><a name='{0}'></a>{0} </sup> <a href='source-{&t}.htm' onclick='showPopUpFrame("""");' target='popup' {}><i>{}</i></a>", iFootnote, oFootnote.ID, strTitle, JoinSourceCitationNames(oFootnote, StrFormatText(oFootnote, StrParseText(oFootnote.title, True)), true)
                  ' remove referenced source from list
                  collSources.Remove(oFootnote)
              Next
          End If
          If collSources.Count > 0 Then ' write details of remaining source/citations
              If Not Session("NestSourceRefs") Then Report.WriteBr Dic.Plurial("SourceCitation" & Util.IfElse(g_collFootnotes.Count > 0, "_Other",""), collSources.Count)
              strSep = ""
              For Each oFootnote in collSources
                  strTitle = StrPlainText(oFootnote, Util.FirstNonEmpty(oFootnote.Subtitle, oFootnote.Description, oFootnote.QuotedText, Dic("SourceInformation")))
                  If (strTitle <> "") Then
                      strTitle = Util.FormatString(" title='{}'", strTitle)
                  End If
                  Report.WriteFormatted strSep & " <a href='source-{&t}.htm' onclick='showPopUpFrame("""");' target='popup' {}><i>{}</i></a>", oFootnote.ID, strTitle, JoinSourceCitationNames(oFootnote, StrFormatText(oFootnote, StrParseText(oFootnote.title, True)), true)
                  strSep = Util.IfElse(Session("NestSourceRefs"), "<br />", ",")
              Next
          End If
          Report.WriteLn "</div>"
          If Session("NestSourceRefs") Then
          Report.WriteBr "</li/ul></li></ul></div>"
      End If
             g_collFootnotes.clear
      End If
End Sub


The extra parameter then needs to be added as follows:

contacts.htm:   WriteHtmlAllFootnotes c.Sources, true
family.htm:       WriteHtmlAllFootnotes f.Sources, false
individual.htm: WriteHtmlAllFootnotes i.Sources, false
picture.htm:     WriteHtmlAllFootnotes p.Sources, true
pictures.htm:    WriteHtmlAllFootnotes p.Sources, true


Posted Friday, June 3, 2011 - Post #28481
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

FamilyTrees.GenoPro.com
Customers
GenoPro version: 3.1.0.1

Last Login: Thursday, June 2, 2022
Posts: 108, Visits: 1,280
The screenshot is taken from pictures.htm (generated with Narrative_2011.05.29)

http://support.genopro.com/Uploads/Images/ba235f8f-e4df-47cf-b96a-cba2.jpg

It demonstrates two cosmetic irregularities, the first is the big space after Sources/Citations before the first source - caused by the <br /> after a <div> statement (last line of the code below - have tested with out that <br /> and it seems to work fine on all the htm templates)

' Write all the footnotes to the report
Sub WriteHtmlAllFootnotes(oSources)
  Dim collSources
  Set collSources = Util.NewGenoCollection()
  If Not Util.IsNothing(OSources) Then collSources.Add(oSources.ToGenoCollection)
  If (g_collFootnotes.Count > 0) Or (collSources.Count > 0) Then
      If Session("NestSourceRefs") Then
          Report.WriteLn "<div class='clearleft'><ul class='xT'>"
          Report.WriteFormattedLn "    <li class='xT2-{} xT-h' onclick='xTclk(event,""2"")'>", Util.IfElse(g_fCollapseReferences, "c", "o")
          Report.WriteFormattedLn "<a name='SourcesCitations'></a><h3 class='xT-i inline'>{&t}</h3><ul class='xT-h'><li>", Dic.Plurial("SourceCitation", 2)
      End If
      Report.WriteLn "<div class='footnote clearleft'><br />"


The second cosmetic issue only applies when the routine is called from pages like pictures.htm where as you can see the other section headers are note sized rather than <h3>.
Posted Thursday, June 2, 2011 - Post #28480
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

FamilyTrees.GenoPro.com
Customers
GenoPro version: 3.1.0.1

Last Login: Thursday, June 2, 2022
Posts: 108, Visits: 1,280
cool - many thanks!
Posted Monday, May 30, 2011 - Post #28461
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 9:23 PM
Posts: 3,464, Visits: 26,854
Thanks for this suggestion and code. I can see it improves the page appearance when there are many source/citation references.  Revision 2011.05.29 of the Narrative Report skin (see Latest 'English Narrative Report' skin  ) has a Configuration Parameter setting to provide this presentation option.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Posted Saturday, May 21, 2011 - Post #28406
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

FamilyTrees.GenoPro.com
Customers
GenoPro version: 3.1.0.1

Last Login: Thursday, June 2, 2022
Posts: 108, Visits: 1,280
I've made a little change to the layout of the sources & citations for the individuals and families pages in my custom template.

It promotes this part of the page to a section, so it can be expanded and collapsed, it also tweaks the layout of the unreferenced sources, so they're listed one per line below the referenced sources.

Example before & after screenshots, and code changes (based on Narrative_2011.05.13) are below if you decide it is a useful tweak.

Before
http://support.genopro.com/Uploads/Images/7493077e-1e34-4c54-b570-4c74.jpg

After
http://support.genopro.com/Uploads/Images/acf6f002-3fc5-4c67-b5a8-7b91.jpg

The modified subroutine code for this in util.vbs is:


Sub WriteHtmlAllFootnotes(oSources)
Dim collSources
Set collSources = Util.NewGenoCollection()
If Not Util.IsNothing(OSources) Then collSources.Add(oSources.ToGenoCollection)
If (g_collFootnotes.Count > 0) Or (collSources.Count > 0) Then
        Report.WriteBr    "<div class='clearleft'><ul class='xT'>"
        Report.WriteFormattedLn "    <li class='xT2-{} xT-h' onclick='xTclk(event,""2"")'>", Util.IfElse(g_fCollapseReferences, "c", "o")
        Report.WriteFormattedLn "<a name='Sources & Citations'></a><h3 class='xT-i inline'>{&t}</h3><ul class='xT-h'><li>", Dic("SourceCitations")
        Report.WriteLn "<div class='footnote clearleft'>"

        If (g_collFootnotes.Count > 0) Then
            Dim iFootnote, oFootnote, strTitle, strSep, s
            iFootnote = 0
            For Each oFootnote In g_collFootnotes
                iFootnote = iFootnote + 1
                strTitle = StrPlainText(oFootnote, Util.FirstNonEmpty(oFootnote.Subtitle, oFootnote.Description, oFootnote.QuotedText, Dic("SourceInformation")))
                If (strTitle <> "") Then
                    strTitle = Util.FormatString(" title='{}'", strTitle)
                End If
                Report.WriteFormattedBr "<sup><a name='{0}'></a>{0} </sup> <a href='source-{&t}.htm' onclick='showPopUpFrame("""");' target='popup' {}><i>{}</i></a>", iFootnote, oFootnote.ID, strTitle, JoinSourceCitationNames(oFootnote, StrFormatText(oFootnote, StrParseText(oFootnote.title, True)), true)
                ' remove referenced source from list
                collSources.Remove(oFootnote)
            Next
            g_collFootnotes.clear
        End If
        If collSources.Count > 0 Then ' write details of remaining source/citations
            strSep = ""
            For Each oFootnote in collSources
                strTitle = StrPlainText(oFootnote, Util.FirstNonEmpty(oFootnote.Subtitle, oFootnote.Description, oFootnote.QuotedText, Dic("SourceInformation")))
                If (strTitle <> "") Then
                    strTitle = Util.FormatString(" title='{}'", strTitle)
                End If
                Report.WriteFormattedbr "<a href='source-{&t}.htm' onclick='showPopUpFrame("""");' target='popup' {}><i>{}</i></a>", oFootnote.ID, strTitle, JoinSourceCitationNames(oFootnote, StrFormatText(oFootnote, StrParseText(oFootnote.title, True)), true)
            Next
        End If
        Report.WriteLn "</div>"
    End If
End Sub


An addition is needed in the dictionary.xml

<SourceCitations T="Sources/Citations"/>





Edited: Monday, May 23, 2011 by GenoProSupport


Similar Topics

Click to view RSS...
Expand / Collapse

Reading This Topic

Expand / Collapse