Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorStanley
    • CommentTimeAug 16th 2009 edited
     permalink
    EDIT: Please see my 3rd post for how I did it - not ideal, but it works for me.

    It seems Live Writer wraps the footnotes tag in "p" tags so they don't work until I visit my blog and edit them back out again.

    If I try this:

    This is some text[1]
    This is some really useful[2] information[3]

    [footnotes]

    [1] footnote 1
    [2] footnote 2
    [3] footnote 3


    Live Writer posts this:

    <p>This is some text[1]</p>
    <p>This is some really useful[2] information[3]</p>

    <p>[footnotes]</p>

    <p>[1] footnote 1</p>
    <p>[2] footnote 2</p>
    <p>[3] footnote 3</p>


    If I edit the tags out before I post it it just posts this, which also doesn't work:

    This is some text[1] This is some really useful[2] information[3] [footnotes] [1] footnote 1 [2] footnote 2 [3] footnote 3

    I can't find any setting in Live Writer to just send plain text.

    The only (partial) solution I've come up with is to wrap the footnotes section in PRE tags, but the last "^Top" link appears underneath the formatted section - which actually looks rather a cool yellow on Deckay - I could live with that apart from the last link going for a walk.

    But I'd rather it just worked without having to put any hand written code into Live writer's source pane.

    Edit: wish --> can I edit plugin.footnotes.php to get that "^Top" link to appear at the start of the footnote? Some of my footnotes are quite long and when you click the reference number in the main content it jumps to that link - sometimes this means that the user has to scoll back up a little, to get to the start of the footnote. It would keep them all in a nice neat column too.

    Edit2: I managed to get the return link to show at the start of the footnote - this works fine if you just create footnotes via the admin panel, and wrapping them in "PRE" tags via Live Writer also works, up to a point. Unfortunately using "PRE" tags wreaks havoc with my page layout.

    Anyway, for anyone who's interested, here's the amendment I made to lines 28 to 31 of plugin.footnotes.php to move the return link:

    '<li>'.
    "<a id=\"$id-fn-{$n}\" href=\"#$id-rel-{$n}\" ".
    "title=\"Back {$n}\">^back</a> ".trim($s).
    '</li>';


    Now, if only I could get Live Writer to create and post footnotes that would be great.
    •  
      CommentAuthorStanley
    • CommentTimeAug 16th 2009 edited
     permalink
    I think I've almost nailed it.
    "pre" tags would work perfectly well (for me) except that the closing "pre" tag ends up appearing before the list closing tags in the final page:

    </a> This the last footnote
    </pre>
    </li>
    </ol>
    </div>


    I don't know if it's possible to get this to appear like this (which would work)

    </a> This the last footnote
    </li>
    </ol>
    </div>
    </pre>


    My own really hacky solution is to close the list and div before I put the closing "PRE" tag then reopen then again (so they get closed again by the footnotes plugin script).

    EDIT - see much "cleaner hack" in my 3rd post below

    <p>This is a really hacky solution![1]</p>

    <p>This is some really useful[2] information[3] </p>
    <pre>
    [footnotes]
    [1] footnote 1
    [2] footnote 2
    [3] This the last footnote
    </li>
    </ol>
    </div>
    </pre>
    <div>
    <ol>
    <li>


    Not ideal, but I'll go with that for now unless someone can offer me a better, less "interventional" solution.
    •  
      CommentAuthorStanley
    • CommentTimeAug 17th 2009 edited
     permalink
    I've solved it as much as I need to for my own purposes.

    The problem again (to save people scrolling back up) is that Live Writer will wrap the "[footnotes]" tag in HTML "p" tags, which will make the Footnotes Plugin ignore it.

    My solution (hack) is to enclose all the footnotes in "pre" tags, which will stop Live Writer from doing that. I then added some script to replace the "pre" tags with nothing. This is because using "pre" tags introduces another problem - read my earlier posts or trust me.

    BEFORE YOU BEGIN - please make a copy of your plugin.footnotes.php file in case this all goes horribly wrong for you!

    1) Insert footnotes section at the very end of your post (in Live Writer) as follows. I use a WLW plug-in called Dynamic Templates to add the code, which is:

    <pre>DO NOT EDIT THIS LINE OR THE NEXT ONE######
    [footnotes]
    [1] Write your footnote here
    [2] Add additional footnotes like this (delete this line if you want)
    ######DO NOT EDIT OR WRITE BELOW THIS LINE</pre>


    2) I handled this code by editing plugin.footnotes.php as follows:

    a) inserted the following 4 lines at line 82

    $text = str_ireplace("<pre>DO NOT EDIT THIS LINE OR THE NEXT ONE######", "", $text);
    $text = str_ireplace("######DO NOT EDIT OR WRITE BELOW THIS LINE</pre>", "", $text);
    $text = str_ireplace("<pre>", "", $text);
    $text = str_ireplace("</pre>", "", $text);


    The last 2 lines are needed if you switch back to the edit pane and start adding new footnotes or put hyperlinks in them, etc. I found that WLW will split the section up by closing off the first "pre" tag and opening a new one. These two lines take care of that scenario.

    You may also like to move the "^top" link to the start of each footnote too, I find it a lot better. See the edit at the end of my original post for that.
    •  
      CommentAuthorNoWhereMan
    • CommentTimeAug 17th 2009
     permalink
    you might want to try editing the HTML source from live writer; btw footnotes just isn't designed for that ;)
    •  
      CommentAuthorStanley
    • CommentTimeAug 19th 2009
     permalink
    Posted By: NoWhereManyou might want to try editing the HTML source from live writer; btw footnotes just isn't designed for that ;)


    I tried everything from the "Live Writer" end - it IS possible to edit the source but I found it to be a very haphazard process and probably not worth most people's time. But, now I've figured out how to get footnotes to work (lol!) I think they're a useful feature for people who are writing research report and dissertations etc., where they want to jot down references as they go along. I just wanted an idiot-proof way (for me) to do in Live Writer what I can do via the admin panel.

    I finally figured out a way to do it - it's not pretty but it seems to be working ok so it's all described above if anyone else wants to try it.

    On "moving the "^top" link to the start of the footnote" - I've found that to be a great improvement. If you've got a long document and (like I have sometimes) quite detailed footnotes (i.e. more than one line with links etc. there too) then clicking on the number takes you to the "^top" link as usual, but this sometimes means that you have to scroll up to read the first line or two of the footnote itself. Having them at the start (I renamed them "^back" too!) looks a lot neater as well, and seems to separate the footnotes out better (to me).

    Footnotes with return link moved to the start of the note