Fetch data stored in table of Page type in Uni Selector source

Walid Farghal asked on February 14, 2020 14:16

We are trying to load data into UniSelector from database table created against the custom pagetype but we are unable to figure out how to mention the Object Type in this case. Like for custom table, we have to mention in this format customtableitem.<customtableCodeName>, so how do we mention in case of pagetype?

Recent Answers


Arjan van Hugten answered on February 14, 2020 14:39

Hi,

Do you want to retrieve all your custom page types? Or what are you trying to achieve? For example if you want all page types of a specific website you could use the following UNI selector properties:

  • Object type: cms.documenttype
  • Return column name: ClassName
  • Object site name: sitename
  • Selection mode: Single drop down list
0 votesVote for this answer Mark as a Correct answer

Dat Nguyen answered on February 14, 2020 15:08 (last edited on February 14, 2020 15:11)

Each page type has a code name that was automatically given when you created the page type. You can see the page type's code name when you go to the Page Types application. Use that code name for the object type.

0 votesVote for this answer Mark as a Correct answer

Walid Farghal answered on February 14, 2020 16:09

@Dat Nguyen, I know the code name for the Page Type and I did try to put that code name in Object Type field and then I put one of the field names in the Return Column Name field for uni selector but when i try to add new record in Data tab, i get error message then the New Record page does not display at all, instead An error occurred and your request couldn't be completed.. displays on the page.

Can you please give a working example of how to put the Page Type name in Object Type? I was thinking that since the syntax for Custom table was such as customtableitem.<customtableCodeName> so similarly i have to use some kind of reserve word before putting the code name for page type..

0 votesVote for this answer Mark as a Correct answer

Walid Farghal answered on February 14, 2020 16:11

@Arjan, basically i added a Uni selector field inside a custom table, the data of which should be fetched from a PageType. The name of the pagetype is AIM_Congress_Speakers. so, how do i put use this in Object Type?

0 votesVote for this answer Mark as a Correct answer

Arjan van Hugten answered on February 14, 2020 16:22

@Walid Farghal

Then you could use the WHERE on the UNI selector. ClassName = 'AIM_Congress_Speakers'. The next thing is getting the return column right. What do you need there?

0 votesVote for this answer Mark as a Correct answer

Mikhail Dervel answered on February 17, 2020 06:45 (last edited on February 17, 2020 06:46)

Hi Walid. According to this answer Similar questions you should specify parameters as on screen below

Uni selector settings

1 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on February 17, 2020 10:26

You can also use cms.document.pagetypeCodeName format to select only given page type pages.

0 votesVote for this answer Mark as a Correct answer

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