[TYPO3-Solr] TYPO3 6.2.15 & Solr: problem with htmlSpecialChars in links

Bert Bert
Tue Nov 10 09:16:29 CET 2015


Hello Jigal,

Thanks for your reply...
In fact, I use the ###IF###-markers right now but I needed/preferred a 
TS-solution.

Converting 'title' into COA did NOT help somehow:

plugin.tx_solr.search.results.fieldRenderingInstructions {
   title = COA
   title {

      10 = CASE
      10 {
         key.field = type

         pages = TEXT
         pages.value = <img src="fileadmin/images/icons/page-icon.png" />

         tx_solr_file = TEXT
         tx_solr_file.value = <img 
src="fileadmin/images/icons/pdf-icon.png" />
      }
      20 = TEXT
      20 {
         field = title
         htmlSpecialChars = 1
         htmlSpecialChars.preserveEntities = 1
      }
   }
}

However, "<" and "/>" are still converted to HTML-entities...

What do I overlook?

Thanks and regards,
Bert



On 09/11/15 11:47, Jigal van Hemert wrote:
> Hi,
>
> On 08/11/2015 18:25, Bert Hiddink [BENDOO e-work solutions] wrote:
>> Using TYPO3 6.2.15, Solr 3.0.2, tika 2.0.0-dev and solrfal 2.0.1
>>
>> With the following snippet, I want to prepend every link with an icon,
>> according its type:
>>
>> plugin.tx_solr.search.results.fieldRenderingInstructions {
>>       title = TEXT
>>       title {
>>          field = title
>>          htmlSpecialChars =1
>>          htmlSpecialChars.preserveEntities =1
>>
>>              prepend = CASE
>>              prepend {
>>              key.field = type
>>
>>              pages = TEXT
>>              pages.value = <img
>> src="fileadmin/images/icons/page-icon.png" />
>>
>>              tx_solr_file = TEXT
>>              tx_solr_file.value = <img
>> src="fileadmin/images/icons/pdf-icon.png" />
>>          }
>>      }
>> }
>>
>> However, htmlSpecialChars.preserveEntities =1 does not respect the  "<"
>> and "/>" tags, these are rendered as "&lt;" and "/&gt;" respectively.
>>
>> What is wrong here? Any suggestions? Thanks in advance!
>
> Nothing is wrong here. htmlSpecialChars is doing exactly what it's
> supposed to do (converting &, ', ", < and > to HTML entities). The
> option 'preserveEntities' will prevent double encoding (otherwise &#39;
> would be encoded to &quot;#39).
>
> In your case it might be easier to implement the icons in the template.
> You can use some ###IF### markers to insert the icons with certain
> document types.
>
> Otherwise you'd have to turn 'title' into a COA, make your CASE the
> first part en set the title field (with htmlSpecialChars) to the second
> part.
>
> title = COA
> title {
>   10 = CASE
>   10 {
>      key.field = type
> ...
>    20 = TEXT
>    20 {
>      field = title
>      htmlSpecialChars = 1
>      htmlSpecialChars.preserveEntities = 1
>    }
> }
>



More information about the TYPO3-project-solr mailing list