We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37165
    • 89 Posts
    So I am using a placeholder to check if a TV from my MIGX db has any values. This is my call

    						[[migxLoopCollection?
    							&packageName=`artwork`
    							&classname=`artWorks`
    							&where=`{"artist_resource_id":"[[*id]]"}`
    							&tpl=`@CODE:[[+exhibition_resource_id]]`
    							&outputSeparator=`||`
    							&toPlaceholder=`resource_ids`
    							]]
    


    Sometimes even though there are no values I get results that look like this from the placeholder "|||||||||||" the amount of lines varies. If there are values in there the placeholder looks like this " 25||34||16"

    Basically what I want to happen is that if the placeholder is empty or has more than three "|" together than it would do nothing. If it has anything else it executes the code. So this is what I tried:


    					[[+resource_ids:is=`%|||%`:or:is=``:then=``:else=`<li class="submenuSidebar hideMobile">
    						<a class="heading">Exhibitions</a>
    							<ul>
    							[[getResources?
    							&parents=`-1`
    							&resources=`[[+resource_ids:replace=`||==,`]]`
    							&tpl=`tpl_exhibition_link`
    							]]
    																					
    							</ul>					
    					</li>`]]



    But I'm not having any luck. Anyone have any idea as to why?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      There isn't a "like" or "contains" modifier. You can create a snippet to use as a custom modifier, though. [ed. note: sottwell last edited this post 12 years, 4 months ago.]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 37165
        • 89 Posts
        Quote from: sottwell at Jun 13, 2014, 11:37 AM
        There isn't a "like" or "contains" modifier. You can create a snippet to use as a custom modifier, though.

        Thanks. I can see how that would work but custom modifiers are a little over my head. I don't really know php.