+ Reply to Thread
Page 1 of 6 1 2 3 ... LastLast
Results 1 to 10 of 52

Thread: Including recent changes on the home page

  1. #1
    Join Date
    Feb 2008
    Posts
    286

    Default Including recent changes on the home page

    I am setting up a debate club wiki on wik.is. Due to the competitive nature of Debate, the wiki needs to be a private wiki. I would like to include the recent changes on the home page so that students can see what other students are working on.

    I have tried several creative approaches, but no luck:

    1. I was not able to get wiki.page is not able to reference special pages. This seemed like the most obvious approach.
    2. Next I tried using feed.list and pointint to the recent changes RSS feed for the wiki. This worked great for a public wiki, but would not work for a private wiki. It would be very nice to have a wiki call out to provide the recent changes RSS feed inside the wiki using the current users validation.
    3. Next I tried to use the web.iframe with a link to the print preview of the recent changes special page. This was the closest I found, but it still includes the print dialog at the top and the iframe is a fixed size without a scroll bar.

    I was able to implement something like this under media wiki for a different debate club and it has been a very useful feature for the students. Any thoughts/tricks would be appreciated.

    Craig

  2. #2
    Join Date
    Oct 2007
    Location
    Edmonton, Cananda
    Posts
    322

    Default

    I've found a way to restrict what portion of a page iframe displays, using CSS, however the editor strips out all the important pieces when you save. I'll post it here in case anyone else can figure it out.

    If you switch to html editor, paste the contents of the attached file, and switch back to the regular editor, it should show nicely the Recent Changes page. However as soon as you save it wrecks the css formatting.
    Attached Files

  3. #3
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    As admin, you should be able to save CSS in your page, but you can't force it to be in <head> section. It can only appear inside the body.

    Did you try inlining the styles on the <iframe> element?
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  4. #4
    Join Date
    Oct 2007
    Location
    Edmonton, Cananda
    Posts
    322

    Default

    Not quite sure what you mean by your question (I'm not very knowledgable about CSS and html, I just stumble along), but in any case, my example isn't a usable one, as any link clicked in the iframe won't change the page of the browser, just the page in the iframe.

    However I do have a follow-up question. I'm using the feed.list extension to populate a "recent changes" list from our wiki's own "whats new" RSS feed. This is working great. Is it possible to change the behavior of the link so that it uses the same window to follow the link instead of opening a new IE window?

    My suspicion is that this is hard-coded IE behavior, but if there's a way to force it to use the same window, that would be awesome.

  5. #5
    Join Date
    Oct 2007
    Location
    Edmonton, Cananda
    Posts
    322

    Default

    HA! I got the iframe thing working, and craigsivils, it also works in wik.is.

    What you said Steve helped; I had to put the style info in a div tag, and in the iframe itself. This is what the code looks like:

    Code:
    <div style="overflow: hidden; width: 656px; position: relative; height: 600px">
        <iframe id="iframeContent" src="http://deki-wiki/Special:Recentchanges" frameborder="0" scrolling="no" style="left: -210px; width: 800px; position: relative; top: -130px; height: 700px"></iframe>
      </div>
    And the result is the attached image. Just edit the height and width values until it fits the content you want to show. I'm going to be using this to display the first 2 or 3 lines of a page that contains a {{wiki.anypage("title:User*")}} for a random user section.

    The only remaining problem with this is that users are going to click the links in that Recent Changes, and they'll open in the iframe, not the parent window. From what I have researched, the only way to change that behaviour is to modify the link itself with a target="_top".

    If anyone can figure out how to have the links from an iframe open in the parent window without modifying the links, I would be ecstatic, as it would also solve my previously mentioned problem with feed.list.
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	iframe.jpg‎
Views:	163
Size:	20.9 KB
ID:	311  

  6. #6
    Join Date
    Feb 2007
    Location
    San Diego, CA
    Posts
    733

    Default

    However I do have a follow-up question. I'm using the feed.list extension to populate a "recent changes" list from our wiki's own "whats new" RSS feed. This is working great. Is it possible to change the behavior of the link so that it uses the same window to follow the link instead of opening a new IE window?
    Attached is a RSS extension that uses the same window to follow the link. If there is anything else about it you would like to tweak, it is easy to change since the extension is written in XML/JavaScript and does not require recompilation. To use it:

    - Save the attached rss.xml.text as rss.xml
    - Add the service:
    Open Control Panel->Service Management
    Add a new local service
    Set type=extension, SID=http://services.mindtouch.com/deki/draft/2007/12/dekiscript.
    Add the following config param: manifest=xxx, where xxx is the file location of rss.xml.
    - Once the service has been added, you can use it with the following: {{ rss( "http://rss.news.yahoo.com/rss/topstories", 2 ) }}
    The first parameter specifies the feed link. The second parameter is optional and specifies the max entries.
    Attached Files

  7. #7
    Join Date
    Oct 2007
    Location
    Edmonton, Cananda
    Posts
    322

    Default

    Thanks Brigettek. I set it up following your instructions, and it worked perfectly for the yahoo news feed. However it gives an error of "Feed could not be loaded". I took a look at the xml, and it looks like it's using google's rss service, which would be why it's not working as our wiki is internal only, and not available on the Internet.

    So in short, I may use this feature for other feeds, because it's really good, however I'll keep looking for internal feeds.

  8. #8
    Join Date
    Feb 2007
    Location
    San Diego, CA
    Posts
    733

    Default

    Sorry to hear the rss feed didn't work for your scenario.

    This is kind of a hack, but if you want to set the links in the iframe to have target="_top", you could do something like the following. Note that this will change all links in the frame to have target="_top", which might not be intended for the previous and next buttons shown after viewing changes by a user:

    Code:
    <div style="overflow: hidden; width: 656px; position: relative; height: 600px;"> <iframe onload="var links = frames.iframeContent.document.links; for (var i = 0; i &lt; links.length; i++) {links[i].target='_top';}" scrolling="no" frameborder="0" style="left: -210px; width: 800px; position: relative; top: -130px; height: 700px;" src="http://deki-wiki/Special:Recentchanges" name="iframeContent" id="iframeContent"></iframe> </div>
    Last edited by brigettek; 02-14-2008 at 01:40 AM.

  9. #9
    Join Date
    Oct 2007
    Location
    Edmonton, Cananda
    Posts
    322

    Default

    Thanks brigettek! This worked perfectly! You're my hero

  10. #10
    Join Date
    Oct 2007
    Location
    Edmonton, Cananda
    Posts
    322

    Default

    Oh no I updated to 1.9.0 and now the hack doesn't work.

    When I paste the code into the html mode and then switch back to normal, it's fine, and if I then switch back to html it's still fine, but as soon as I save the page, it strips out all of the extra code you added Brigettek. Any idea why?

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts