Is there a keyword modifier that will exclude non-WYSIWYG components


(Kieran) #1

Matrix Version: 6.26.0

Hi guys,
I want to use an asset listing to create a feed of Standard Page assets.
These Stnadard Pages are made up of WYSIWYG components, as well as custom made components.
When outputting a pages contents using keyword, it (rightfully) brings through all the contents, including all the modules.
This wont play well with the external site that consumes this feed. It works fine if I dont include other components in the Standard Pages, but I was hoping I could.
Is there a keyword modifier that will print the page contents, but allows me to say “only WYSIWYG components”?


(Mel Freeman) #2

Hi Kieran!

It is possible to do an asset listing of WYSIWYG components. I can imagine you setting up a listing so that it just pulls through those.

The next trick is then pulling out their content. At that point, asset_contents doesn’t work. You need to use asset_data_attributes I think.

Mel


(Kieran) #3

Hey Mel!
Hope you’re doing well.
I should have thought of this. The listing includes news items too, so it’s a bit trickier.
Currently, I use a Search Page asset, as I have some URL queries that change what is output.
The assets this will search through are News Item assets, though I want to also include standard pages, but just the WYSIWYG components of them.

If I have the search page include WYSIWYG components, it wont pull them together as pages.
For instance, it wont output title, summary, metadata and then all thw WYSIWYG components together for that one page.
But now I think about it, I may be able to have 2 type formats: one for news and one for standard page. In the standard page, I list the components of the asset I’m referencing.
Will try that. Thanks for the hint!


(Mel Freeman) #4

It’s tricky.

One thing I’ve discovered recently is that search pages are very slow. So if there’s any way to do it with an asset listing instead, it will be faster.

Full story - used a search page to try and feed a Funnelback collection some URLs. Funnelback was getting timeouts from the search page. Did an asset listing which basically did the same thing with a keyword modifier condition, and no more time out.


(Kieran) #5

Yeah I agree with that. In this instance though, it’s a feed that responds with different assets depending on URL queries sent to it. So we can isolate articles tagged with XYZ, and/or tagged with ABC.

Edit: we do cache it decently too.


(Kieran) #6

Hi again Mel, you put me on the right track.
My problem now is that custom components are defaulted to “WYSIWYG” types when added to a page - defeating the whole purpose unless they are manually changed to something else when added!
I should have checked, but I assumed a “Custom Component” would have been inserted as “Custom Component” or the likes, rather than a WYSIWYG. Now there’s no way to differentiate custom components from regular WYSIWYG components, without going through and changing them all!