XSLTSearch Options
mlovegrp5
Posted: Friday, November 28, 2008 4:44:54 PM
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
drobar
Posted: Friday, November 28, 2008 5:59:05 PM

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

Full docs are available in both places as well.

cheers,
doug.

MVP 2007-2009 - Percipient Studios
mlovegrp5
Posted: Monday, December 01, 2008 12:56:56 PM
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
mlovegrp5
Posted: Monday, December 01, 2008 2:08:17 PM
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
drobar
Posted: Monday, December 01, 2008 3:37:24 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
mlovegrp5
Posted: Tuesday, December 02, 2008 4:49:38 PM
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
drobar
Posted: Tuesday, December 02, 2008 5:19:37 PM

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
mlovegrp5
Posted: Tuesday, December 02, 2008 5:50:19 PM
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
drobar
Posted: Tuesday, December 02, 2008 7:26:36 PM

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
mlovegrp5
Posted: Wednesday, December 03, 2008 12:41:33 PM
Rank: Newbie

Joined: 11/19/2008
Posts: 11
Location: Glasgow, Scotland
Cool, will have a look.

Cheers,

Marc
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.