Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/ https://fsfe.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

280 lines
9.6 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<html>
<head>
<title>Documentation - Tagged news and events, country pages</title>
</head>
<body class="article web" microformats="h-entry" id="documentation-tags">
<p id="category"><a href="/contribute/web/">Webmastering</a></p>
<h1 class="p-name">Documentation: Tagged news and events, country pages</h1>
<div class="e-content">
<p id="introduction" class="p-summary">
As you can see on <a href="/uk/uk.html">the UK page</a>,
it is possible to display news or events that have a special tag,
e.g. a country code.
This helps setting up pages easily with specific news items or events.
The list of people displayed on this same page has also been automated,
so it makes it easy to implement your own country page.
</p>
<!--p>
<img src="/graphics/icons/warning.png" />
The first system we have used, an attribute consisting of
comma-separated values, was not very adapted to the way we generate
dynamic information.
Therefore, we have opted for the hereunder defined system, a more
xml-style one.
</p-->
<h2>Basic instructions</h2>
<p>
A tag should be in <a href="https://en.wikipedia.org/wiki/CamelCase">CamelCase</a> except for special tags like <code>front-page</code>, <code>newsletter</code>. So for instance, the tag “very important subject” should be <code>VeryImportantSubject</code>.
A tag should contain a <code>content</code> attribute except for special tags. <bold>This attribute should be translated and human readable</bold>, because it will be shown on certain pages. For instance, if you tag a page about the Windows Tax and about a ruling:
</p>
<pre class="file">
&lt;tag content="Windows Tax"&gt;WindowsTax&lt;/tag&gt;
&lt;tag content="Ruling"&gt;Ruling&lt;/tag&gt;
</pre>
<h2>Tag pages, news and events</h2>
<p>For most pages (when your file has the <var>xhtml</var>), the tags must be added within &lt;html&gt; &lt;/html&gt; usually at the end.</p>
<p>
A list of tags currently in use can be found <a href="/tags/tags.html">here</a>.
We also have a list of <a href="/tags/tagged.html">all tagged pages, events and news</a>. <strong>Please check these pages first</strong> to avoid making duplicated tags, use existing tags if possible to keep things consistent.
</p>
<ul>
<li>For certain news item the tags must be within &lt;news&gt; &lt;/news&gt; if your file has the <var>xml</var> extension:</li>
</ul>
<pre class="file">
&lt;news&gt;
[...]
&lt;tags&gt;
&lt;tag&gt;front-page&lt;/tag&gt;
&lt;tag content="Software Patents"&gt;Swpats&lt;/tag&gt;
&lt;tag content="Novell"&gt;Novell&lt;/tag&gt;
&lt;/tags&gt;
&lt;/news&gt;
</pre>
<ul>
<li>For events, within &lt;event&gt; &lt;/event&gt;:</li>
</ul>
<pre class="file">
&lt;event&gt;
[...]
&lt;tags&gt;
&lt;tag&gt;front-page&lt;/tag&gt;
&lt;tag content="Italy"&gt;it&lt;/tag&gt;
&lt;/tags&gt;
&lt;/event&gt;
</pre>
<p>Please note that only events and news items being tagged as <var>front-page</var>
will appear on the front page of fsfe.org!</p>
<p>
Tags should all be written in English; there is no need for translation
since the tags do not appear online, but are used internally for
filtering news items or events.
</p>
<h3>Using the fetch-news template</h3>
<ul>
<li>
the <var>tag</var> parameter defines what news will be displayed. If you are
building up a country page, this is your country code. Leave blank
if you wish to receive news items with any tags.
</li>
</ul>
<pre class="file">&lt;xsl:with-param name="tag" select="'<var>your tag</var>'"/&gt;</pre>
<ul>
<li>
the <var>nb-items</var> parameter determines how many news items will be displayed
</li>
</ul>
<pre class="file">&lt;xsl:with-param name="nb-items" select="'<var>x</var>'" /&gt;</pre>
<h3>Using the fetch-newsletter template</h3>
<p>Works exactly as the fetch-news template, but does not propose tagging yet.</p>
<h3>Using the fetch-events template</h3>
<p>
fetch-events works in a very similar manner to fetch-news, <var>tag</var> and <var>nb-items</var>
work the same way. Here are some addings:
</p>
<ul>
<li>
the <var>wanted-time</var> parameter defines what events you want
to display, "past", "present" or "future"
</li>
</ul>
<pre class="file">&lt;xsl:with-param name="wanted-time" select="'<var>future|present|past</var>'" /&gt;</pre>
<ul>
<li>
the <var>header</var> parameter determines the text that will be displayed on top
of your block of events (used e.g. on events/events.xsl).
Possible values are 'future', 'current' or 'past'. Leave blank if you
don't want any header.
</li>
</ul>
<pre class="file">&lt;xsl:with-param name="header" select="'<var>future|current|past</var>'" /&gt;</pre>
<ul>
<li>
the <var>display-details</var> parameter says if 'yes' or 'no' you will have
the text of each event displayed along with its date and title.
</li>
</ul>
<pre class="file">&lt;xsl:with-param name="display-details" select="'<var>yes|no</var>'" /&gt;</pre>
<h2>Implementing a country page</h2>
<p>
Implementing a country page won't take you long.
<a href="/uk/uk.html">United Kingdom</a> and
<a href="/de/de.html">Germany</a> country pages are a good example
of what you can achieve easily and how.
</p>
<p>
<strong>1. </strong>
The very first thing to do is to create a folder with your country
code, e.g. "/de", "/uk" or "/it" in the root folder of the fsfe-web
svn (you will see other country folders there).<br/>
You may want to copy the three common files you'll find in already
existing country folders, e.g uk.en.xhtml, uk.xsl and uk.sources,
and of course rename them accordingly.
</p>
<p>
<strong>2. </strong>
You should not have to modify **.sources.
You want to change the <var>countrycode</var>
variable in the **.xsl file to your country code, modifying the
following line.
<pre class="file">&lt;xsl:variable name="country-code"&gt;<var>xx</var>&lt;/xsl:variable&gt;</pre>
In the **.**.xhtml page, you should only change the identi.ca
account, or deactivate it if your country team does not have one yet.
<pre class="file">"user":"fsfeuk",</pre>
Play further with this file if you want to change the display of
your country page.
</p>
<h3>Using the country-people-list template</h3>
<ul>
<li>(the call to country-people-list in **.xsl is responsible for the displayed people list)</li>
<li>add the <var>xx</var> tag to corresponding people in /about/people/people.en.xml, e.g.</li>
</ul>
<pre class="file">&lt;person id="mueller" member="yes" teams="main, de"&gt;</pre>
<p>
People tagged with your country code will appear in your country
page's people list. (If you want to add a person that is not there yet,
be careful not to add him/her to the "main" team if he/she is not
a member of it).
</p>
<p>
For people's pictures, you should put a 48*48 pixels picture in the
/about/<var>id</var> folder named <var>id</var>-avatar.jpg. Then edit
<var>/about/people/people.en.xml</var> and add a line for
<var>avatar</var> to the picture URL.
</p>
<h3>Tagging author, date and download files</h3>
<p>
In order to give proper credits to the authors of articles you can add
tags like these:
</p>
<pre class="file">
&#60;author&#62;
&#60;name&#62;John Doe&#60;/name&#62;
&#60;link&#62;http://johndoe.me&#60;/link&#62;
&#60;avatar&#62;http://johndoe.me/me.png&#60;/avatar&#62;
&#60;/author&#62;
&#60;!-- For FSFE team members, you can take the information directly
from /about/people/people.en.xml, for instance: --&#62;
&#60;author id="gerloff" /&#62;
&#60;date&#62;
&#60;revision content="2010-03-24" /&#62;
&#60;original content="2009-11-27" /&#62;
&#60;/date&#62;
&#60;!-- Feel free to add more than one revision tag if see fit --&#62;
&#60;download type="pdf" content="/link/to/download-file.pdf" /&#62;
</pre>
<p>
Bear in mind that these tags should be included like any other tags, that means they should be at the end, before &#60;/html&#62;
</p>
</div>
<!--/e-content-->
</body>
<sidebar promo="about-fsfe">
<div id="related-content">
<h3>Other howtos:</h3>
<ul>
<li>
<a href="/contribute/web/css.html">Edit the CSS with LESS</a>
</li>
<li>
<a href="/contribute/template.html">A template article, to use the new webdesign</a>
</li>
<li>
<a href="/contribute/campaigns-frontpage.html">Add and select campaign banners for the frontpage</a>
</li>
</ul>
</div>
</sidebar>
<tags>
<tag>webmaster</tag>
</tags>
<timestamp>$Date: 2010-07-07 05:16:55 +0200 (Wed, 07 Jul 2010) $ $Author: hugo $</timestamp>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->