Changeset 28329


Ignore:
Timestamp:
2013-09-30T16:26:08+13:00 (11 years ago)
Author:
jlwhisler
Message:

Updated Home page tutorial to use library_name variable instead of hard-coding library. Added an icon for the page. Updated the AddUser url.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentation/trunk/tutorials/xml-source/tutorial_en.xml

    r27937 r28329  
    50625062Ensured every tag had a closing tag (or was self-closing)<br />
    50635063Corrected the paths for the CSS stylesheet and image<br />
    5064 Added in links to certain Greenstone pages (like the <i>Login</i>, <i>Help</i>, and <i>Preferences</i> pages).<br /></Text>
    5065 </NumberedItem>
    5066 <NumberedItem>
    5067 <Text id="hp-09">Adding links to specific pages is relatively straightforward. If you want to link to the backdrop collection, for instance, you could simply add in <Format>&lt;a href=&quot;library/collection/backdrop&quot;&gt;backdrop&lt;/a&gt;</Format>. However, if you have many collections, this is time consuming, and the home page would have to be modified every time you added or removed a collection. Instead, we can use XSL to insert appropriate HTML into our page for each collection in our library. First, we will <b>define</b> a template that does this, and then we will <b>call</b> this template in the right spot in our HTML.</Text>
     5064Added in links to certain Greenstone pages (like the <i>Login</i>, <i>Help</i>, and <i>Preferences</i> pages).<br />
     5065Added a page icon.<br /></Text>
     5066</NumberedItem>
     5067<NumberedItem>
     5068<Text id="hp-09">Adding links to specific pages is relatively straightforward. If you want to link to the backdrop collection, for instance, you could simply add in <Format>&lt;a href=&quot;{$library_name}/collection/backdrop/page/about&quot;&gt;backdrop&lt;/a&gt;</Format>({$library_name} is a variable that, in this case, will become &quot;library&quot; -- you will learn more about library names in later tutorials). However, if you have many collections, this is time consuming, and the home page would have to be modified every time you added or removed a collection. Instead, we can use XSL to insert appropriate HTML into our page for each collection in our library. First, we will <b>define</b> a template that does this, and then we will <b>call</b> this template in the right spot in our HTML.</Text>
    50685069</NumberedItem>
    50695070<Heading>
     
    50825083    <Tab n="1"/>&lt;xsl:variable name="collectionName" select="@name"/&gt;<br />
    50835084        <Tab n="2"/>&lt;li&gt;<br />
    5084         <Tab n="2"/>&lt;a href="library/collection/{$collectionName}/page/about"&gt;<br />
     5085        <Tab n="2"/>&lt;a href="{$library_name}/collection/{$collectionName}/page/about"&gt;<br />
    50855086        <Tab n="2"/>&lt;xsl:value-of select="displayItem[@name='name']"/&gt;<br />
    50865087        <Tab n="2"/>&lt;/a&gt;<br />
     
    51735174        <Tab n="2"/>&lt;xsl:when test="$username"&gt;<br />
    51745175            <Tab n="3"/>&lt;li&gt;&lt;a&gt;<br />
    5175                 <Tab n="4"/>&lt;xsl:attribute name="href"&gt;library/admin/AccountSettings?s1.username=&lt;xsl:value-of select="$username"/&gt;&lt;/xsl:attribute&gt;&lt;xsl:value-of select="$username"/&gt;<br />
     5176                <Tab n="4"/>&lt;xsl:attribute name="href"&gt;&lt;xsl:value-of select="$library_name"/&gt;/admin/AccountSettings?s1.username=&lt;xsl:value-of select="$username"/&gt;&lt;/xsl:attribute&gt;&lt;xsl:value-of select="$username"/&gt;<br />
    51765177            <Tab n="3"/>&lt;/a&gt;&lt;/li&gt;<br />
    5177             <Tab n="3"/>&lt;li&gt;&lt;a href="library/admin/Register"&gt;Register a new user&lt;/a&gt;&lt;/li&gt;<br />
    5178                     <Tab n="4"/>&lt;li&gt;&lt;a href="library/admin/ListUsers"&gt;Administration&lt;/a&gt;&lt;/li&gt;<br />
    5179             <Tab n="3"/>&lt;li&gt;&lt;a&gt;&lt;xsl:attribute name="href"&gt;library?logout=&lt;/xsl:attribute&gt;Logout&lt;/a&gt;&lt;/li&gt;<br />
     5178            <Tab n="3"/>&lt;li&gt;&lt;a href="{$library_name}/admin/AddUser"&gt;Register a new user&lt;/a&gt;&lt;/li&gt;<br />
     5179                    <Tab n="4"/>&lt;li&gt;&lt;a href="{$library_name}/admin/ListUsers"&gt;Administration&lt;/a&gt;&lt;/li&gt;<br />
     5180            <Tab n="3"/>&lt;li&gt;&lt;a&gt;&lt;xsl:attribute name="href"&gt;&lt;xsl:value-of select="$library_name"/&gt;?logout=&lt;/xsl:attribute&gt;Logout&lt;/a&gt;&lt;/li&gt;<br />
    51805181        <Tab n="2"/>&lt;/xsl:when&gt;<br />
    51815182        <Tab n="2"/>&lt;xsl:otherwise&gt;<br />
    5182             <Tab n="3"/>&lt;li&gt;&lt;a href="?a=p&amp;amp;sa=login&amp;amp;redirectURL=library%3Fa=p%26sa=home"&gt;Login<br />
     5183            <Tab n="3"/>&lt;li&gt;&lt;a href="?a=p&amp;amp;sa=login&amp;amp;redirectURL={$library_name}%3Fa=p%26sa=home"&gt;Login<br />
    51835184                <Tab n="4"/>&lt;xsl:attribute name="title"&gt;&lt;xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/&gt;&lt;/xsl:attribute&gt;<br />
    51845185            <Tab n="3"/>&lt;/a&gt;&lt;/li&gt;<br />
     
    51915192<Text id="hp-24">Then, find the following section:</Text>
    51925193<Format>
    5193 &lt;li&gt;&lt;a href="?a=p&amp;sa=login&amp;redirectURL=library%3Fa=p%26sa=home"&gt;Login&lt;/a&gt;&lt;/li&gt;<br />
    5194 &lt;li&gt;&lt;a href="library/admin/AccountSettings?s1.username="&gt;Account Settings&lt;/a&gt;&lt;/li&gt;<br />
    5195 &lt;li&gt;&lt;a href="library/admin/AddUser"&gt;Register a new user&lt;/a&gt;&lt;/li&gt;<br />
    5196 &lt;li&gt;&lt;a href="library/admin/ListUsers"&gt;Administration&lt;/a&gt;&lt;/li&gt;<br />
    5197 &lt;li&gt;&lt;a href="library?logout="&gt;Logout&lt;/a&gt;&lt;/li&gt;<br />
     5194&lt;li&gt;&lt;a href="?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home"&gt;Login&lt;/a&gt;&lt;/li&gt;<br />
     5195&lt;li&gt;&lt;a href="{$library_name}/admin/AccountSettings?s1.username="&gt;Account Settings&lt;/a&gt;&lt;/li&gt;<br />
     5196&lt;li&gt;&lt;a href="{$library_name}/admin/AddUser"&gt;Register a new user&lt;/a&gt;&lt;/li&gt;<br />
     5197&lt;li&gt;&lt;a href="{$library_name}/admin/ListUsers"&gt;Administration&lt;/a&gt;&lt;/li&gt;<br />
     5198&lt;li&gt;&lt;a href="{$library_name}?logout="&gt;Logout&lt;/a&gt;&lt;/li&gt;<br />
    51985199</Format>
    51995200<Text id="hp-25">And replace it with this:</Text>
Note: See TracChangeset for help on using the changeset viewer.