Magic Data Select attribute
Permalink Browser Info Environment
I need to be able to assign specific user(s) to a page so I can then do a page-list associated with the individual users. There may be more than one user associated with a page.
I am trying to use a MD select attribute (page attribute) to get a list of users in a certain group, but am getting the following error: "No options available in this context".
My MD expression to list items to be selected is"Agents AS_GROUP LIST_USERS 100 APPLY_EACH USER_NAME END_APPLY_EACH HTML_UL" which tests out fine in the attribute setup screen and gives me the correct list of users, but fails when I try to use it on the page properties -> custom attributes screen and gives me the above error.
I do not have an expression for the labels. Not sure if I need one or what to put there?
Or, maybe there is another way to accomplish this!
Thanks in advance for your help.
~Mike
I am trying to use a MD select attribute (page attribute) to get a list of users in a certain group, but am getting the following error: "No options available in this context".
My MD expression to list items to be selected is"Agents AS_GROUP LIST_USERS 100 APPLY_EACH USER_NAME END_APPLY_EACH HTML_UL" which tests out fine in the attribute setup screen and gives me the correct list of users, but fails when I try to use it on the page properties -> custom attributes screen and gives me the above error.
I do not have an expression for the labels. Not sure if I need one or what to put there?
Or, maybe there is another way to accomplish this!
Thanks in advance for your help.
~Mike
Type: | Discussion |
---|---|
Status: | Archived |
Ahhh. OK, got it, but now I can't get my UberList to find the pages. MD expression = (SET 219 AS_PAGE LIST_ALL_PAGES_WITH_FILTER "listing_agent_md" "sharon.drake" 20 SORT_BY TIME_PUBLIC END_SORT_BY REVERSE) finds no pages, but there are 2.
Have you added the attribute to the page search index and rebuilt the search index?
Which version of the above did you use? If the first, then the attribute value will be a user id, so you will need to do make the list parameter
( SET 'sharon.drake' AS_USER )
Yes, I re0indexed the search pages, and the attribute is included.
I used the 1st version above, but I'm not sure where to include the ( SET sharon.drake AS_USER ) code.
I used the 1st version above, but I'm not sure where to include the ( SET sharon.drake AS_USER ) code.
As the value you are matching for the attribute in the list, so
SET 219 AS_PAGE LIST_ALL_PAGES_WITH_FILTER "listing_agent_md" ( SET 'sharon.drake' AS_USER ) 20 SORT_BY TIME_PUBLIC END_SORT_BY REVERSE
Nope. I had tried similar, but used quotes instead of parenthesis. I also had tried "12" which is the user ID for sharon.drake. Where can I find the actual attribute to verify it's existence? The MD select attribute is displaying the user list that I want, but it doesn't seem to be remembering my selection.
~Mike
~Mike
If you do the dashboard sitemap/page search, you should be able to use the column selection to add it as a column to the list.
Or, in phpMyAdmin, look at the table CollectionSearchIndexAttributes and it will appear as a column.
You could also try substituting LIST_ALL_PAGES_WITH_FILTER_CONTAINING. Sometimes attributes (particularly multi-select attributes) are padded with \n as a separating character.
You could also try making the user name the value of the attribute, so for the attribute list
Attribute value
And for the listing
I am away from tomorrow to 23, so will probably only have sporadic email contact and won't have access to my dev system.
Or, in phpMyAdmin, look at the table CollectionSearchIndexAttributes and it will appear as a column.
You could also try substituting LIST_ALL_PAGES_WITH_FILTER_CONTAINING. Sometimes attributes (particularly multi-select attributes) are padded with \n as a separating character.
You could also try making the user name the value of the attribute, so for the attribute list
'Agents' AS_GROUP LIST_USERS 100 APPLY_EACH USER_NAME END_APPLY_EACH
Attribute value
AS_USER USER_NAME
And for the listing
SET 219 AS_PAGE LIST_ALL_PAGES_WITH_FILTER_CONTAINING "listing_agent_md" 'sharon.drake' 20 SORT_BY TIME_PUBLIC END_SORT_BY REVERSE
I am away from tomorrow to 23, so will probably only have sporadic email contact and won't have access to my dev system.
I'm not sure which or both, probably the combination, that worked, but it worked! Thank you so much!!!
With C5, your add-ons, and supurb service, DIY's like me can achieve custom web applications. Simply amazing!
Thanks Again!
With C5, your add-ons, and supurb service, DIY's like me can achieve custom web applications. Simply amazing!
Thanks Again!
That would make a great comment for a review when you have a few minutes to spare.
I will mark this thread as resolved.
I will mark this thread as resolved.
Behind the scenes the select attribute code decides how that should be displayed.
Behind the scenes you probably want to select user IDs
List expression ( a list of user IDS)
Agents AS_GROUP LIST_USERS 100
Each item (translate a user ID into a name)
============================
Or for selecting user ID by email
List expression ( a list of user IDS)
Agents AS_GROUP LIST_USERS 100
Each item (translate a user ID into a name)
============================
Or for selecting an email by User Name
List expression ( a list of user email addresses)
Agents AS_GROUP LIST_USERS 100 APPLY_EACH EMAIL END_APPLY_EACH
Each item (translate an email into a name)