Webmastering

Documentation: Tagged news and events, country pages

As you can see on the UK page, 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.

Basic instructions

A tag should be in CamelCase except for special tags like front-page, newsletter. So for instance, the tag “very important subject” should be VeryImportantSubject. A tag should contain a content attribute except for special tags. This attribute should be translated and human readable, because it will be shown on certain pages. For instance, if you tag a page about the Windows Tax.

      <tag content="Windows Tax">WindowsTax</tag>
    

If you are translating, you should never edit what is “here” between <tag>here</tag> but you can add a translated content attribute. For instance, take an English file with:

      <tag>Ruling</tag>
    

“Ruling” in French would be “Décision de justice” so you should do:

      <tag content="Décision de justice">Ruling</tag>
    

Tag pages, news and events

For most pages (when your file has the xhtml), the tags must be added within <html> </html> usually at the end.

A list of tags currently in use can be found here. We also have a list of all tagged pages, events and news. Please check these pages first to avoid making duplicated tags, use existing tags if possible to keep things consistent.

  • For certain news item the tags must be within <news> </news> if your file has the xml extension:
      <news>
      [...]
      <tags>
      <tag>front-page</tag>
      <tag content="Software Patents">Swpats</tag>
      <tag content="Novell">Novell</tag>
      </tags>
      </news>
    
  • For events, within <event> </event>:
      <event>
      [...]
      <tags>
      <tag>front-page</tag>
      <tag content="Italy">it</tag>
      </tags>
      </event>
    

Please note that only events and news items being tagged as front-page will appear on the front page of fsfe.org!

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.

Using the fetch-news template

  • the tag 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.
<xsl:with-param name="tag" select="'your tag'"/>
  • the nb-items parameter determines how many news items will be displayed
<xsl:with-param name="nb-items" select="'x'" />

Using the fetch-newsletter template

Works exactly as the fetch-news template, but does not propose tagging yet.

Using the fetch-events template

fetch-events works in a very similar manner to fetch-news, tag and nb-items work the same way. Here are some addings:

  • the wanted-time parameter defines what events you want to display, "past", "present" or "future"
<xsl:with-param name="wanted-time" select="'future|present|past'" />
  • the header 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.
<xsl:with-param name="header" select="'future|current|past'" />
  • the display-details parameter says if 'yes' or 'no' you will have the text of each event displayed along with its date and title.
<xsl:with-param name="display-details" select="'yes|no'" />

Implementing a country page

Implementing a country page won't take you long. United Kingdom and Germany country pages are a good example of what you can achieve easily and how.

1. 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).
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.

2. You should not have to modify **.sources. You want to change the countrycode variable in the **.xsl file to your country code, modifying the following line.

<xsl:variable name="country-code">xx</xsl:variable>
In the **.**.xhtml page, you should only change the identi.ca account, or deactivate it if your country team does not have one yet.
"user":"fsfeuk",
Play further with this file if you want to change the display of your country page.

Using the country-people-list template

  • (the call to country-people-list in **.xsl is responsible for the displayed people list)
  • add the xx tag to corresponding people in /about/people/people.en.xml, e.g.
<person id="mueller" member="yes" teams="main, de">

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).

For people's pictures, you should put a 48*48 pixels picture in the /about/id folder named id-avatar.jpg. Then edit /about/people/people.en.xml and add a line for avatar to the picture URL.

Tagging author, date and download files

In order to give proper credits to the authors of articles you can add tags like these:

        <author>
          <name>John Doe</name>
          <link>http://johndoe.me</link>
          <avatar>http://johndoe.me/me.png</avatar>
        </author>

        <!-- For FSFE team members, you can take the information directly
        from /about/people/people.en.xml, for instance: -->
        <author id="gerloff" />
        
        <date>
          <revision content="2010-03-24" />
          <original content="2009-11-27" />
        </date>
        
        <!-- Feel free to add more than one revision tag if see fit -->
        
        <download type="pdf" content="/link/to/download-file.pdf" />
    

Bear in mind that these tags should be included like any other tags, that means they should be at the end, before </html>