Hi,
I am using SimpleSearch on a site which is great, but in the results can't display a TV for the summary content, it can only read the [[*content]] field - therefore, I am looking for a way to automatically make the [[*content]] field on a page mirror the content of a specified TV - is this possible?
e.g. if TV [[*Example]] was <p>Hello</p>, then I would like the [[*content]] field to automatically get populated with the same content as the TV [[*Example]] - thus it would be <p>Hello</p>.
Is this possible? If so... how?
Thanks.
dubbs
In version 1.9, you can specify the &extract property to come from a TV. Simply add &includeTVs=`1` to your call and change or add &extractSource=`your_tv_name`. This work.
A MODx Fanatic
Thanks Treigh - Yeh I had found that since posting this, but the issue I have, is that I have many different TVs which would need to be the extractSource - so it does not solve my issue - e.g. on different page types, the content I want included in the search results summary changes, on some pages its [[*content]], on others its [[*ExampleTV]] and on others for example its [[*AnotherTV]] - so using the [[*content]] field for the extractSource works best - but I need a fix to allow the [[*content]] field to be set to pull from a TV on the pages that I am not using the [[*content]] for the content I want the search results to pull from.
How about a plugin connected to OnParseDocument. You could replace the tags manually before MODX parses them.
Bob, if you think that will work - then it sounds good to me... any tips on how to achieve such a thing?
Sorry about that dubbs, I completely missed it. Too much coffee taken late isn't apparently good for my brains.
A MODx Fanatic
I'm guessing here somewhat, but I think the plugin code would be this two-liner (connected to OnParseDocument):
$content = $modx->resource->getTVValue('ExampleTv');
return '';
This would require MODX 2.2 or greater.