CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Feature #5920

Facet 'type' should be translateable

Added by Michiel Roos over 3 years ago. Updated over 2 years ago.

Status:Resolved Start date:2010-01-07
Priority:Should have Due date:
Assignee:Ingo Renner % Done:

100%

Category:Frontend Plugins
Target version:-
TYPO3 Version: Has patch:
PHP Version: Tags:
Votes: 0

Description

Currently my filter looks like:

Resultaat verfijnen
Content Type
o pages 88
o file 81

The customer does not understand 'file' and 'page'.


Related issues

duplicated by Apache Solr for TYPO3 CMS - Feature #6144: Find a way to translate facet labels Closed 2010-01-21

History

Updated by Schmidt Timo over 3 years ago

Michiel Roos wrote:

Currently my filter looks like:

Resultaat verfijnen Content Type o pages 88 o file 81

The customer does not understand 'file' and 'page'.

You can do that with TypoScript:

 renderingInstruction = CASE
 renderingInstruction.key.field = optionValue
 renderingInstruction.pages = TEXT
 renderingInstruction.pages.value = Pages

But i also think this can be done diffrent.

Updated by Michiel Roos over 3 years ago

Thank you Timo!

That works great.

Here is my snippet for posterity:

plugin.tx_solr {
    search {
        faceting {
            facets {
                type {
                    renderingInstruction = CASE
                    renderingInstruction {
                        key.field = optionValue
                        pages = TEXT
                        pages.value = Pages
                        file = TEXT
                        file.value = Documents
                    }
                }
                language {
                    renderingInstruction = CASE
                    renderingInstruction {
                        key.field = optionValue
                        0 = TEXT
                        0.value = English
                        1 = TEXT
                        1.value = Dutch
                    }
                }
            }
        }
    }
}

If you need different labels for different languages, you should wrap these TS sections with language conditions.

Updated by Ingo Renner almost 3 years ago

Thanks for sharing your solutions guys, great spirit! And I'm also happy that the extension is so flexible already! ;)

I'll leave this issue open for now, but will mark it as resolved once I move your snippets to the documentation in the wiki. Can you agree with that? I'm still open for easier solutions, although I think it won't get any more flexible than this.

Updated by Michiel Roos almost 3 years ago

Agreed

Updated by Jean-Bernard Valentaten over 2 years ago

Just a short comment on #2:
I'm not sure what you mean by 'wrap these TS sections with language conditions', but for all TS-newbies (like myself), there is a very flexible and easy to use trick if you want to localize the labels. TEXT-types provide a lang-Attribute to localize their value, so Michiels' code could be extended to:

plugin.tx_solr {
    search {
        faceting {
            facets {
                type {
                    renderingInstruction = CASE
                    renderingInstruction {
                        key.field = optionValue
                        pages = TEXT
                        pages.value = Pages
                        pages.lang.de = Seiten
                        file = TEXT
                        file.value = Documents
                        file.lang.de = Dokumente
                    }
                }
                language {
                    renderingInstruction = CASE
                    renderingInstruction {
                        key.field = optionValue
                        0 = TEXT
                        0.value = English
                        0.lang.de = Englisch
                        1 = TEXT
                        1.value = Dutch
                        1.lang.de = Niederländisch
                    }
                }
            }
        }
    }
}

Aside of that, thanks Timo and Michiel for the solution you guys provided, you just saved me a couple of hours of work :)

Updated by Ingo Renner over 2 years ago

  • Category set to Frontend Plugins
  • Status changed from New to Resolved
  • Assignee set to Ingo Renner
  • % Done changed from 0 to 100

Moved the examples from the comments to the documentation in the wiki: http://forge.typo3.org/projects/extension-solr/wiki/Tx_solrsearch#facetingfacetsfacetrenderingInstruction

Also available in: Atom PDF