Getting data from a multiple choice property of a custom page type

Operations Team asked on January 19, 2017 11:02

Hi guys, I have a custom page type which represents the technologies that are used for the clients on my kentico site. On my clients page type I have a multiple choice property which looks at every technology and lets me assign the tech to the client, which is what I want! However, when I set the property it goes into the database as "01|02|04" etc which is a pain for me because when I go to my client's page I want to be able to see what technologies they're using. So I guess my question is, what's the best way to extract those Id's from the client table, link them to the technology and then display the name of that tech on the client page?

Thanks in advance guys!

Callam

Recent Answers


Roman Hutnyk answered on January 19, 2017 12:52 (last edited on January 19, 2017 13:00)

I'd go with either custom macro or custom transformation method depending on where you're going to use it. This is where you could parse field value and retrieve appropriate data from database.

2 votesVote for this answer Mark as a Correct answer

Petar Kozjak answered on January 19, 2017 13:53 (last edited on December 10, 2019 02:30)

Hi,

here is one example what you could do. In case you want this on detail page only you could use repeater with custom query. You need create query for page type SELECT [ItemID], [ColorDisplayName] FROM DD_CategoryColors WHERE ##WHERE##

Create transformation for listing all of tehnoliges.

Add web part where it is needed and as where condtition use macro {% "ItemID in (" + CurrentDocument['NameOfFiled'].Replace("|", ",") + ")" |(identity)GlobalAdministrator%}

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.