I am working on setting up a new site and am getting an error with one of my template variables. Here is my problem:
In my template I have [*SidebarContent*], this is used to show items on the right side of my page.
I have created a folder named Sidebar Items and then have different documents under that (i.e. Searchbox, updated pages, etc).
In my template variable [*SidebarContent*] I use the following @select to get my list of items:
@SELECT pagetitle, concat("@document ",id) as selvalue from modx_site_content where parent=2
I am also using a multi select list box, so a user could select multiple items for the sidebar.
When I select one item from the list it works correctly, however when Iselect multiple items for the tv, I get the following error:
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4) AND sc.published=1 AND sc.deleted=0 ) AND (sc.privateweb=0) LIMIT 1' at line 3 »
SQL: SELECT DISTINCT sc.* FROM `dbname`.modx_site_content sc LEFT JOIN `dbname`.modx_document_groups dg on dg.document = sc.id WHERE (sc.id IN (3||@document 4) AND sc.published=1 AND sc.deleted=0 ) AND (sc.privateweb=0) LIMIT 1
I see that the error is probably due to me using the @document binding but am not sure how to fix it. If anyone can help with this I would appreciate it. Or if there is a better way to do this I would appreciate the input.
Thanks in advance,
Kyle