|
|
Rank: Newbie
Joined: 11/19/2008 Posts: 11 Location: Glasgow, Scotland
|
I am trying to setup XSLTSearch on a site I am developing. The download for the original file is not working: http://packages.umbraco.org/packages/website-utilities/xsltsearch?callback=&version=Does anyone know where I can get a copy? Cheers, Marc
|
|
 Rank: Umbracoholic
Joined: 9/8/2006 Posts: 1,831 Location: MA, USA
|
You can get it from the package repository (right-click the 'Macros' treeview item and select the Import Package menu, then browse the package repository), or you can get it directly from my site at http://www.percipientstudios.com/xsltsearch.aspxFull docs are available in both places as well. cheers, doug.
MVP 2007-2009 - Percipient Studios
|
|
Rank: Newbie
Joined: 11/19/2008 Posts: 11 Location: Glasgow, Scotland
|
Hi Doug,
Thanks for this. I will give the search a bash.
Cheers,
Marc
|
|
Rank: Newbie
Joined: 11/19/2008 Posts: 11 Location: Glasgow, Scotland
|
Hi Doug,
I have managed to get the search working. Is it possible to check the Document Type for each result and if it matches a specific document type, open the parent node. The reason I am asking is because I have nodes that aren't actual webpages. An example is a list of FAQ items. If my FAQ items come back in the search I want to open the parent page for the FAQ item.
Thanks for your help in advance.
Cheers,
Marc
|
|
 Rank: Umbracoholic
Joined: 9/8/2006 Posts: 1,831 Location: MA, USA
|
|
|
Rank: Newbie
Joined: 11/19/2008 Posts: 11 Location: Glasgow, Scotland
|
Hi Doug, I went for creating a template with a redirect and making all child nodes that do not have a page use this template. Code: <xsl:param name="currentPage"/> <xsl:variable name="RedirectURL" select="$currentPage/parent::node / @id"/> <xsl:template match="/">
<!-- start writing XSLT --> <xsl:if test="$RedirectURL != ''"> <script type="text/javascript"> window.location = "<xsl:value-of select="umbraco.library:NiceUrl($RedirectURL)"/>" </script> </xsl:if>
</xsl:template>
I'm not brave enough to mess about with the XSLT yet. Cheers, Marc
|
|
 Rank: Umbracoholic
Joined: 9/8/2006 Posts: 1,831 Location: MA, USA
|
Nice approach, that'll work! One thing... you might want to include an <a href="{umbraco.library:NiceUrl($RedirectURL)}"> for anyone who has javascript disabled. And hang in there with xslt... you'll pick it up in time. Indeed, your macro for redirecting shows you've already got a good handle on things. cheers, doug.
MVP 2007-2009 - Percipient Studios
|
|
Rank: Newbie
Joined: 11/19/2008 Posts: 11 Location: Glasgow, Scotland
|
Hi Doug, Cheers for the advice. I am slowly starting to get the hang of XSLT however I am still finding it a bit scary at times. W3 Schools seems to be a good starting point. Cheers, Marc
|
|
 Rank: Umbracoholic
Joined: 9/8/2006 Posts: 1,831 Location: MA, USA
|
I love W3 Schools. You'll also want to bookmark Casey's great 'umbraco book' at http://www.umbraco.org/documentation/books/xslt-basics. Extremely helpful. cheers, doug.
MVP 2007-2009 - Percipient Studios
|
|
Rank: Newbie
Joined: 11/19/2008 Posts: 11 Location: Glasgow, Scotland
|
Cool, will have a look.
Cheers,
Marc
|
|
|
Guest |