• Images on 'StartPage'

    By Monideth Pen 2 decades ago

    I cannot get images to appear on a wiki page that is classed as the 'start page' - i.e. page that is number 1 in the root menu. for example:



    http://1.2.3.4/DominoWiki.nsf



    The image will only appear when the wiki page is displayed when using the/Pages/ format. For example:



    http://1.2.3.4/Dominowiki.nsf/Pages/StartPage



    I am using the [image:filename] format to display the image file that I have attatched to the wiki page.



    Is this a feature or a bug?



    Regards,



    Mon

    • Fix for this issue

      By Steven Searson 2 decades ago

      One of our customers (NYK Line) have implemented DominoWiki and came across this same issue. I've had a delve into the code and found a solution:



      If you open the WikiPage.class script library and replace the Function fixRelativeLinks with this code, the issue should be resolved. This uses the domino database path when generating links, rather than just a reference to the page you are on.


      Private Function fixRelativeLinks (Byval txt As String) As String<br/>
          '** convert relative links in &lt;a&gt; and &lt;img&gt; tags to<br/>
          '** &quot;pagename/$file/filename&quot; format, so attached files and<br/>
          '** images are referenced properly<br/>
          Dim srcStart As String, srcEnd As String<br/>
          srcStart = |&lt;img src=&quot;|<br/>
          srcEnd = |&quot;&gt;|<br/>
          fixRelativeLinks = ReplaceRangeEnds(txt, _<br/>
          srcStart, srcEnd, _<br/>
          srcStart &amp; &quot;/&quot; &amp; dbPath &amp; &quot;/pages/&quot; &amp; Me.Subject &amp; &quot;/$file/&quot;, srcEnd, &quot;*[/]*&quot;, False)<br/>
          <br/>
          Dim hrefStart As String, hrefEnd As String<br/>
          hrefStart = |&lt;a href=&quot;|<br/>
          hrefEnd = |&quot;&gt;|<br/>
          fixRelativeLinks = ReplaceRangeEnds(fixRelativeLinks, _<br/>
          hrefStart, hrefEnd, _<br/>
          hrefStart &amp; &quot;/&quot; &amp; dbPath &amp; &quot;/pages/&quot; &amp; Me.Subject &amp; &quot;/$file/&quot;, hrefEnd, &quot;*[/]*&quot;, False)<br/>
      End Function
      
      • By Monideth Pen 2 decades ago

        Thanks, I have also used a workaround to get the images to appear on the root page.



        I used the address that is used to link the attatchments at the bottom of the wiki page.



        For example, the link for the logo.jpg that has been attatched to the wiki page is:



        http://1.1.1.1/DominoWiki.nsf/878FD727FCEE85F38025724C0040D5EE/$file/logo.jpg



        For the Wiki page code I used the following:



        [image:/DominoWiki.nsf/878FD727FCEE85F38025724C0040D5EE/$file/logo.jpg]



        This seems to work OK.



        I will also try out your method.



        Regards,



        Mon