If you change the tagDelimiter to double pipes, ie: || it does not work, however, a single pipe does.
Does anyone know how to get double pipes to work with tagDelimter?
Thanks
I don’t think you can use double pipes as a tag delimiter since the double pipe is used to separate a list of possible TV values, remember ?
I think there is a conflict here, you’re not allowed to use that syntax in the context you want to use it in.
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
So I wasn’t exactly right, it’s a conflict with PHx syntax not TVs, but the way I would fix this is do a search and replace of your double pipes delimiter (stored in a TV, isn’t it ?)... I guess this would be easier than rewriting PHx parser
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
You can’t just change the delimiter in your Ditto call, you also need to alter the records in the DB for the TV used for tags.
The fastest way to do this is use MySQL.
Go to [tt]modx_site_tmplvars[/tt] and check the ID of the TV you use for tags (you’ll use it in the WHERE clause).
[tt]UPDATE modx_site_tmplvar_contentvalues SET value = REPLACE (value, ’||’, ’here put your new delimiter’) WHERE modx_site_tmplvar_contentvalues.tmplvarid=id_of_the_tv_used_for_tags;[/tt]
DISCLAIMER : Careful, my MySQL skills are limited (though I usually manage to get things done with trial-error), you should verify this (or someone from the forums with better skills) or at least try it on a local copy of your DB.
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
Hi.
I’ve done some investigation and tests but it appears that MODX itself stores checkboxes as delimited by double pipes.
So therefore you are correct in that there is a conflict with PHx syntax.
I’ve been trying to work a way around the problem without changing the way MODX stores its delimiters, or changing PHx, or changing MySQL data.
The only other option I’m working on is to change it in a plugin or something.
Why would MySQL search and replace not work ?
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
I’m concerned that I would have to constantly keep changing the delimiter in my snippet, or in a plugin.
Doing a MySQL search and replace would only change the current data, but not change any new data that is inserted into the table.
Any time a new entry is made into a checkbox TV, MODx would store any data captured and encapsulate any multiple choice with the double pipe.
I’m not even sure that MODx would cope with a delimiter that is not a double pipe.
Ok I missed the point it would seem, you’re not using a text field to input tags, but checkbox TVs in which case you can’t choose the delimiter... now it makes sense.
This changes the picture, and the best course of action would be to check with Armand that PHx can be amended to handle such cases... the other alternative is hack modx to change the delimiter which IMHO is not a great way to deal with it (hacks mean maintenance nightmares).
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id