Historical timeline/it happened on this day

Posted by Brunhilda on 28 May 2010 19:03, last edited by Helmuti_pdorf on 28 Dec 2011 11:57

Tags: iframe javascript message

rating: +2+x

Thanks to kawina's question, Timothy Foster came up to this brilliant idea:

Step 1:

Create a page called javascript:iframe-event with the following code:

[[code type="html"]]
<html>
<head>
<script type="text/javascript">
var d = new Date();
var month = d.getMonth()+1;
var day = d.getDate();

var red = "http://sitename.wikidot.com/iframe:event/tags/_m"+month.toString()+"d"+day.toString();

window.location = red;

</script>
</head>
<body>
</body>
</html>

[[/code]]

NOTE: Change sitename to your site's name.

Step 2:
Create a page iframe:event with the following code:

[[module ListPages ... tags="@URL" order="title"]]
%%title%%. %%content%%
[[/module]]

[[module CSS]]
#header,
#side-bar,
#top-bar,
#footer,
#license-area,
#page-title,
#navi-bar,
#navi-bar-shadow,
#breadcrumbs,
.page-tags,
#page-info,
.page-watch-options,
.page-options-bottom,
#footer-bar,
#login-status,
.search-top-box,
#edit-cancel-button{
    display: none !important;
}

#action-area h1, #edit-page-form tbody tr:first-child{
    display: none !important;
}

#main-content, #container-wrap, #container{
    margin: 0;
}

[[/module]]

NOTE: Change the … to whatever the ListPages parameters are.

Step 3:
On your main page, place the following iframe:

[[iframe http://sitename.wdfiles.com/local--code/javascript:iframe-event frameborder="0"]]

NOTE: Change the height and width parameters according to your desire.

Step 4:
Tag every event page with the date it occurred in the following manner:

  • _mmonthddate

month is a numerical value between 1 and 12 (Jan=1, Feb=2, etc)
date is a numerical value between 1 and 31, depending on the date.

A tag for May 27 would look like:

  • _m5d27

I believe that's all the steps. Now, it will automatically sift through the dates depending on what day it actually is since we are using the Date object in Javascript. ListPages is used to display the pages as the Javascript redirects to the page with that module.

Author

Timothy FosterTimothy Foster. Please visit his/her userPage.


Related articles

Comments

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.