by IWR Consultancy
 

Frame design for blogging

Base requirements

In principle, any existing frame can be modded into a blog layout. The required additions are:

  • A call to initialize the blog plugin, which is typically placed in the head section.
  • A call to get data from the blog_catalog() function, and then to echo this data to the webpage. This is typically placed in the hf_content section, after (or instead of) the <!--CONTENT--> placeholder.

That is really all that's needed for a very straightforward blog. Plus a few pages which declare this frame in an hf_frame meta tag, of course. One such page will be named index.php or index.htm(l) and will act as the table of contents, displaying a precis of each article. Other pages will display articles in full.

Additional features

Typical blogs might contain a dropdown menu of available articles, and a 'blogroll' in a separate column from the article content  These features are provided through additional menu files in the sitecfg/ directory. They are used in much the same way as the main dropdown menu, by making a call to the standard Hyperframe menu plugin with the relevant blog feature as the filename. The article menu is automatically updated by each call to blog_catalog(), whilst the blogroll menu is manually created by the webmaster since it is essentially static in nature.  You will likely want to enclose these menus in their own div with a distinct class or ID, since the required css styling is likely to differ somewhat from that of the main site menu. Styling goes into frame.css as usual, and you will note that a blogging frame's frame.css has a few extra sections over those of a static site for this reason. 

Since these items are Hyperframe menus, it stands to reason that you don't have to place them in a righthand bar; they can be placed as a dropdown in a top banner, or anywhere else you can place a menu.

A 'Recently Visited' list is provided through a hf_history() function, a call to which outputs the list in menu format. This function was made a part of the main Hyperframe code since it may also be useful on non-blog pages.  Since it must maintain a running list of pages visited by each individual site visitor, it makes use of the browser session cookie and array rather than a common menu file. A consequence of this mode of working is that the recent list cannot survive a php session timeout where the browser is left inactive (or the computer in standby) for an extended period. However, it provides an elegant solution to providing visitor-specific information without violating the EU persistent-cookie notification directive.

Samples

The distribution contains the blog and blog2 frames. The former uses the straightforward unordered list approach, with any images present being placed in righthand float alongside the relevant article. The latter uses the more advanced serialized array approach, thus the formatting code is in frame.php itself. In this case a tabular layout is used to give a more regularly-spaced set of items. The actual markup is entirely up to you, and if wish you can use HTML5's document section syntax here. 

Notes

If you don't want site visitors to inappropriately select your blog's frame when viewing mainsite content, then name the frame starting with a period. -as is standard linux convention for hidden files. In the distributiion this has not been done, since it may be useful to observe the effect of using a blog frame on the main content. You will notice that apart from some unsuitable first paragraphs it works remarkably well, in spite of the content never having been intended for a blog. 

 


Recently Visited

Related Pages
Powered by Hyperframe