FirefoxBookmarkPlugin

This is a little instructions page on how to create a Firefox Bookmarks plugin. This plugin works in harmony with the "Bookmark Sync and Sort" Plugin for Firefox, which can be found at .

This document discribes how your up to date Firefox bookmarks can automatically be uploaded and displayed in your flux cms. This way you have your bookmarks for to go.

1. Create a new collection and name it whatever you like. For reference purposes, lets say you named it Bookmarks.

2. It is important that an index file for the collection is created. You can do this with the editor of your preference. Check with you ftp program if data/Bookmarks/ was really created. In case you want to use the fulltext search engine, leave the content blank. Make the collection visible.

3. Create a new .configxml in your new collection. You can create a new .configxml via your admin panel -> Bookmarks (your new collection) -> Config -> Add .configxml. Enter the following code into the .configxml :

<?xml version="1.0"?>
<bxcms xmlns="http://bitflux.org/config">

    <plugins>

	<parameter name="xslt" type="pipeline" value="xbel.xsl"/>

        <extension type="html"/>
        <plugin type="xhtml"></plugin>
        <plugin type="navitree"></plugin>
    </plugins>

</bxcms>

4. Put a file called xbel.xsl into the themes folder that you use. For example, if you use the 2 column design put the xbel.xsl file into the themes/2-cols/ folder. The xbel.xsl file should look like this:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:i18n="http://apache.org/cocoon/i18n/2.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xhtml">

    <xsl:import href="../standard/common.xsl"/>
    <xsl:import href="master.xsl"/>


    <xsl:output encoding="utf-8" method="xml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="no" />

    <xsl:template name="content">
        		<xsl:variable name="body" select="/bx/plugin[@name='xhtml']/xhtml:html/xhtml:body"/>
                <xsl:apply-templates select="$body/node()" mode="xhtml"/>


    <!-- Above are the template and theme are applied. Below is the xbel integration -->


    <xsl:for-each select="//folder">
     <p>
       <xsl:choose>
          <!-- Do not display the Bookmarks Toolbar Folder. -->
          <xsl:when test="title='Bookmarks Toolbar Folder'"> 
          </xsl:when>


          <xsl:otherwise>

           <i><xsl:value-of select="title"/></i><br/>
            <xsl:for-each select="bookmark">
             <a href="{@href}" target="_blank"><xsl:value-of select="title"/></a>

	     <br />

     	    </xsl:for-each>
     	  </xsl:otherwise>


       </xsl:choose>

      </p>
    </xsl:for-each>
    </xsl:template>


    <!-- below are some more theme and template necessasities -->

    <!-- add everything from head to the output -->
    <xsl:template name="html_head">
        <xsl:apply-templates select="/bx/plugin[@name='xhtml']/xhtml:html/xhtml:head/node()" mode="xhtml"/>
    </xsl:template>
    
    <!-- except the title -->
    <xsl:template match="xhtml:head/xhtml:title" mode="xhtml">
    </xsl:template>


    <!-- except the links -->

    <xsl:template match="xhtml:head/xhtml:link" mode="xhtml">
    </xsl:template>
    
    <!-- do not output meta tags without @content -->
    <xsl:template match="xhtml:head/xhtml:meta[not(@content)]" mode="xhtml">
    </xsl:template>
    
    <xsl:template name="body_attributes">
    <xsl:apply-templates select="/bx/plugin[@name='xhtml']/xhtml:html/xhtml:body/@*" mode="xhtml"/>
    </xsl:template>
    

</xsl:stylesheet>

5. Setup your Firefox Bookmarks Sync and Sort Plugin to upload and rename the xbel.xml file to data/Bookmarks/index.en.xhtml in your flux cms directory. The original index.en.xhtml sould be replaced, which is intended.

6. In case of creating a mutliple language site, it is possible to create a file such as index.de.xhtml in the Bookmarks folder with the following content:

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:bx="http://bitflux.org/doctypes/bx"

        xmlns:xi="http://www.w3.org/2001/XInclude"

>

                <xi:include href="index.en.xhtml" />

</html>

PS: In case you would like to also display the Bookmarks Toolbar Folder, use the following xbel.xsl file instead:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:i18n="http://apache.org/cocoon/i18n/2.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xhtml">

    <xsl:import href="../standard/common.xsl"/>
    <xsl:import href="master.xsl"/>


    <xsl:output encoding="utf-8" method="xml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="no" />

    <xsl:template name="content">
        		<xsl:variable name="body" select="/bx/plugin[@name='xhtml']/xhtml:html/xhtml:body"/>
                <xsl:apply-templates select="$body/node()" mode="xhtml"/>


    <!-- Above are the template and theme are applied. Below is the xbel integration -->


    <xsl:for-each select="//folder">
     <p>

 

           <i><xsl:value-of select="title"/></i><br/>
            <xsl:for-each select="bookmark">
             <a href="{@href}" target="_blank"><xsl:value-of select="title"/></a>

	     <br />

     	    </xsl:for-each>
     	  
      </p>
    </xsl:for-each>
    </xsl:template>


    <!-- below are some more theme and template necessasities -->

    <!-- add everything from head to the output -->
    <xsl:template name="html_head">
        <xsl:apply-templates select="/bx/plugin[@name='xhtml']/xhtml:html/xhtml:head/node()" mode="xhtml"/>
    </xsl:template>
    
    <!-- except the title -->
    <xsl:template match="xhtml:head/xhtml:title" mode="xhtml">
    </xsl:template>


    <!-- except the links -->

    <xsl:template match="xhtml:head/xhtml:link" mode="xhtml">
    </xsl:template>
    
    <!-- do not output meta tags without @content -->
    <xsl:template match="xhtml:head/xhtml:meta[not(@content)]" mode="xhtml">
    </xsl:template>
    
    <xsl:template name="body_attributes">
    <xsl:apply-templates select="/bx/plugin[@name='xhtml']/xhtml:html/xhtml:body/@*" mode="xhtml"/>
    </xsl:template>
    

</xsl:stylesheet>

Note:

If you intend to use the fulltext search engine, it might be important to delete the fulltext entries for /bookmarks/index.en.xhtml, /bookmarks/index.de.xhtml, etc in the "properties" table of your MYSQL Database. Otherwise the search might display content that is not available on your website. This step might be prevented by creating index files without any content (see step 2 above).

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
These projects are supported by Liip AG