Concatenation and browse config

This is related to Enonic v4.7.5

Is it possible to use concatenation when setting up the browse config for a content type? The id for one of our content types, “person”, is surname, and we’d like to change it to a combination of first name and surname. We could of course just create a field for full name, but it would save time to say that tite is first name and surname concatenated.

Here’s what I use to show both the article number and title in the browse config for a content-type, try something like it:

<column title="Avsnitt">
  <xpath>contentdata/avsnitt</xpath>
  <xml:text>:</xml:text>
  <xpath>contentdata/tittel</xpath>
</column>
1 Like

Forgot that it didn’t work as intended (on 4.7.8 at least), but you can use XPath functions like this:

<column title="Avsnitt">
  <xpath>concat(contentdata/avsnitt, ': ', contentdata/tittel)</xpath>
</column>
2 Likes

Great, thank you! I was expecting that it wouldn’t be possible to be honest :smile:

The browse config is actually very powerful in Enonic, so is the index config. Just sprinkle some xpath on them and you can do some really powerful things.

1 Like