#1 2007-07-15 06:29:46

Brad
Administrator
Registered: 2006-05-10
Posts: 396

StyleSheet Guideline

------------------
||   Location   ||
------------------

Stylesheets can go in
A) ~/Library/Application Support/Cyndicate/StyleSheets/
B) /Library/Application Support/Cyndicate/StyleSheets/

For obvious reasons, the former is preferred/recommended, but Cyndicate
scans both locations.

If you double-click a .cyndicate file (a Cyndicate stylesheet) it will be
installed in location A for you.


-------------------
||   Extension   ||
-------------------

Bundles need to have a .cyndicate extension to be loaded. Bundles are just a
folder with a ".cyndicate" extension. As soon as you rename the enclosing
folder with the extension, the icon should change to a Cyndicate Style icon.
To work with the files inside, just "Show Package Contents." You may want to
create aliases to the documents inside while you're working on them as the
Finder takes every opportunity it gets to close packages back up.


--------------
||   Name   ||
--------------

The name of the style in Cyndicate's menus will be the same as the filename
without the extension.


---------------
||   Files   ||
---------------

style.css
    MANDATORY - Contains the css for the style.
body.html
    OPTIONAL - Contains the HTML layout between <body> tags
print.css
    OPTIONAL - Contains the css that will be used only when printing the article.
Additional Files
    OPTIONAL - Images, javascript libraries, etc. These can be in
subdirectories if you'd like.

If a body.html file is not found, a default layout will be used.


----------------------------------------
||   Default Layout if no body.html   ||
----------------------------------------

<div id="ir_headline">
    <div class="ir_title">
        <a href="[[articleURL]]" title="[[articleTitle]]">[[articleTitle]]</a>
    </div>
    <div class="ir_byline">written by [[articleAutherName]] on [[articleDatePosted]]</div>
</div>
<div class="ir_article">
    [[articleContent]]
    <p>
        <a href="[[articleURL]]" title="[[articleTitle]]">Read Full Article</a>
    </p>
</div>


----------------------------
||   Injection Template   ||
----------------------------

Whether you use the default body or create your own body.html, it will be
inserted between <body> tags in a pre-set template.

<html>
<head>
    <style type="text/css" media=\"screen\">@import "file://%@";</style>
    <style type="text/css" media=\"print\">@import "file://%@";</style> // only if print.css is included
    <title>%@</title> 
</head>

<body id="widescreenViewBody":"traditionalViewBody" class="completeNewsItem"> %@ </body>

</html>

Cyndicate has both a wide screen and a traditional view - his markup will
set the body's ID to either "widescreenViewBody" or "traditionalViewBody"
depending on which view user has chosen. You can thus use this to
dramatically alter the appearance of your theme based on the viewing format.



--------------
||   Keys   ||
--------------

All keys act, obviously, on the information of the single selected article.

[[articleTitle]] - article's title
[[articleURL]] - article's permalink
[[articleContent]] - article's content ("the post" itself)

[[articleDatePosted]] - date article was posted (short date string)
[[articleTimePosted]] - time article was posted (short time string)
[[articleDateReceived]] - date article was received (short date string)
[[articleTimeReceived]] - time article was received (short time string)
[[articleLabelColorValue]] - hexadecimal color value of article's label

[[articleCategory]] - comma-separated list of the article's categories
[[articleRating]] - article's rating (0, 1, 2, 3, 4, 5 with 0 = unrated)

[[articleAuthorName]] - article's author's name (if available)
[[articleAuthorEmail]] - article's author's email (if available)
[[articleAuthorURL]] - feed's homepage url (if available)

[[feedName]] - name of the article's feed
[[feedURL]] - URL of the feed's homepage
[[feedRSSURL]] - URL of the RSS feed
[[feedLabelColorValue]] - hex color value of the feed's label
[[favicon]] - string containing the path to the feed's favicon, will return the default if the feed does not contain one


----------------------
||   Complex Keys   ||
----------------------

These exist primarily for NNW support, but Cyndicate themes can use them too if you wish.

Key: [[newsitem_title]]
Expands To:
<a href="[[articleURL]]">[[articleTitle]]</a>


Key: [[newsitem_dateline]]
Expands To:
<span class="newsItemSource">
    <a href="[[feedURL]]"><img src="[[favicon]]" align="top" height="16" width="16" /></a>
    <a href="[[feedURL]]">[[feedName]]</a>
</span>
<span class="newsItemDate">[[articleDatePosted]] [[articleTimePosted]]</span>
<span class="newsItemCreator">[[articleAuthorName]] [[articleAuthorEmail]] [[articleAuthorURL]]</span>
<span class="newsItemSubject">[[articleCategory]]</span>

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson