Skip to content

Commit

Permalink
Removed XSLT utilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Ghita committed Dec 3, 2013
1 parent d40e436 commit 80c48b9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 192 deletions.
41 changes: 0 additions & 41 deletions README.markdown
Expand Up @@ -71,44 +71,3 @@ All these 3 URLs will request "Sym Single" Page:
- www.example.com/ro/evenimente/single/primul-titlu ---> **sym-events/sym-single**/primul-titlu
- www.example.com/en/events/single/first-title --------> **sym-events/sym-single**/first-title
- www.example.com/fr/evenements/single/premier-titre --> **sym-events/sym-single**/premier-titre



### 3.2 More examples regarding `plh-toolkit.xsl` utility ###

Recommendation: put the navigation DS output in a variable so you can access it easily:

<xsl:variable name="nav" select="/data/navigation" />

Get the URL of a page with ID = 7:

<xsl:apply-templates select="$nav//page[ @id=7 ]" mode="plh-url" />

Get the Title of a page with ID = 7:

<xsl:value-of select="$nav//page[ @id=7 ]/item" />

If you have URL parameters attached to current URL and want to pass them forward, call template `plh-url-parameters` :

<xsl:apply-templates select="$nav//page[ @id=7 ]" mode="plh-url" />
<xsl:call-template name="plh-url-parameters" />

<br />
Building current-page link in all languages:

In `master.xsl`, or wherever you want to put the links, call this template:

<xsl:call-template name="plh-site-languages" />

On pages without parameters it works fine out-of-the-box. However, what do you do with pages that have parameters, such as `title --> event-title` ?<br />
In generating current-page URL in all languages, the `plh-page-parameters` template is called along the way to populate the URL with localised parameters.<br />
So, on each page that has parameters, overload (define) this template with the contents you need.

Because I'm using Multilingual Text, this is how my template looks like (NB: my page parameter is for `Title` field) in `events_title.xsl`:

<xsl:template name="plh-page-parameters">
<xsl:param name="lang" />
<xsl:variable name="country_handle" select="concat('handle-',$lang)" />

<xsl:value-of select="/data/events-datasource-that-outputs-one-event-based-on-page-parameter/entry/title/@*[ name() = $country_handle ]" />
</xsl:template>
2 changes: 1 addition & 1 deletion licence
@@ -1,4 +1,4 @@
Copyright 2012 Vlad Ghita
Copyright 2014 Vlad Ghita

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
150 changes: 0 additions & 150 deletions utilities/plh-toolkit.xsl

This file was deleted.

0 comments on commit 80c48b9

Please sign in to comment.