Hello,
i use this code,
[[Ditto?parents=`[*id*]`&depth=`2`&tpl=`chunk_ad`&where=`template=10`&sort_by=`pub_date`&summarize=`5`&paginate=`1`&paginateAlwaysShowLinks=`1`]]
i want to select documents witch template equal to 10
but i have this error :
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - Unknown column ’sc.templat’ in ’where clause’ »
SQL: SELECT DISTINCT sc.id,sc.published,sc.createdon FROM `clefdune_cdw`.`modx_site_content` sc LEFT JOIN `clefdune_cdw`.`modx_document_groups` dg on dg.document = sc.id WHERE sc.id IN (12,13,14,16) AND sc.published=1 AND sc.deleted=0 AND sc.templat AND (sc.privateweb=0) GROUP BY sc.id ORDER BY sc.createdon DESC
[Copy SQL to ClipBoard]
when i make &where="template>10" it works but &where=`template=10` no
if some one have a solution ?
Hamza
-
☆ A M B ☆
- 24,524 Posts
Can’t have ? & = in parameter values. The snippet processor thinks it’s another parameter=value element.
-
☆ A M B ☆
- 24,524 Posts
Probably the best way to deal with this would be to use an external config file. Your Ditto snippet would only have one parameter, &config=`filename`. Then in the assets/snippets/ditto/configs folder, create a new file "filename.config.php" and put the parameters there as ordinary PHP $paramname = ’value’; variable definition lines. You can have all the & ? = characters you want.
I solved the same problem.
Double `e` in `template`
For example:
[[Ditto?parents=`[*id*]`&depth=`2`&tpl=`chunk_ad`&where=`templatee=10`&sort_by=`pub_date`&summarize=`5`&paginate=`1`&paginateAlwaysShowLinks=`1`]]