Detecting WYSIWYG format in Paint Layouts


(Birdg) #1

Hi,

 

We are on 4.16.0 and I am trying to build an asset list to loop through the Bodycopy Divs on a page. Some are WYSIWYG and some are nested Data Records.

 

I have added a Type format of Data Record and this works as expected. However, when I add a Type format of "WYSIWYG Content Type" it does nothing.

 

I am trying to detect the WYSIWYG blocks and ignore them (ie only print out the Data Records). How else could I prevent them from being printed out?

 

Thanks,

 

Graham


(Anewport) #2

Instead of listing them all and then ignoring, perhaps select "WYSIWYG Content Type" under Asset Types to List on the Details screen of the Asset Listing Page.

Just realised I wrote the wrong type to list and Nick's post covers my point.


(Nic Hubbard) #3

Why do you need to add a type format for WYSIWYG if you are wanting to ignore them? You should just be able to use a blank default format, then specify the type format that you do want to list.

 

Also, why are you listing bodycopy divs when you are wanting to list Data Records? Can you explain what you are trying to do?


(Birdg) #4

Hi Nic,

 

I'm trying to get the basics of a page with a sidebar working (without using JS). I read some other threads which suggested a method where an asset list is nested into the Design file. I am listing the Bodycopy Divs so I have two printouts of the page contents side by side. Now I want to remove the WYSIWYG containers from the second list but this doesn't seem to be possible as they are not "detected" as anything except Bodycopy Divs.

 

Does that make sense?

 

Graham


(Nic Hubbard) #5

Now I want to remove the WYSIWYG containers from the second list but this doesn't seem to be possible as they are not "detected" as anything except Bodycopy Divs.

 

What you want to do is to use your asset listing and list "Content Type" assets, rather than Bodycopy Divs. Make sure to click the "Inherit" checkbox.

 

Doing this, you can now use the %asset_type% keyword to show the correct content type.

 

Will this work for you?


(Birdg) #6

Hi Nic,

 

Thanks a lot - I am now able to list the Content Types and print out the %asset_type% - this is giving me a mixed list of WYSIWYG and Nested content items. However, what I can't work out is how I then print out metadata field values from the Data Records that are nested.

 

Sorry if I am being dense - it's so close to what I am trying to achieve but I can't quite see how to do it.

 

:)

 

Graham


(Nic Hubbard) #7

Hi Nic,

 

Thanks a lot - I am now able to list the Content Types and print out the %asset_type% - this is giving me a mixed list of WYSIWYG and Nested content items. However, what I can't work out is how I then print out metadata field values from the Data Records that are nested.

 

Sorry if I am being dense - it's so close to what I am trying to achieve but I can't quite see how to do it.

 

:)

 

Graham

 

Nested as in, they are using Nested Content divs?


(Birdg) #8

Yes, they are Data Records nested into the page.


(Nic Hubbard) #9

Yes, they are Data Records nested into the page.

 

Hmm, I am not sure this is possible.


(Birdg) #10

:)

 

Oh well, I think I'll give up on that one and use JavaScript to add assets to the sidebar instead then.

 

Thanks for your help though Nic.

 

Graham


(Nic Hubbard) #11

:)

 

Oh well, I think I'll give up on that one and use JavaScript to add assets to the sidebar instead then.

 

Thanks for your help though Nic.

 

Graham

 

I am still confused about what exactly you are trying to do. There has to be an easier way. What were you going to do to solve this in JS?

 

Do you have a screenshot of what you are trying to accomplish?


(Birdg) #12

Hi Nic,

 

Thanks for persevering!

 

Essentially I want Edit+ authors to be able to put nested content containers into the page's content area or a sidebar. I'd done some reading on the forum and there seemed to be two usual methods - an asset list for the sidebar or using JS to "move" designated containers into a sidebar (via a class or similar).

 

I agree that there must be an easier way but I'm not seeing it so far. I nearly had it by listing Bodycopy Divs from the current page but there doesn't seem to be a way to exclude the WYSIWYG containers.

 

Any thoughts?

 

Graham


(Nic Hubbard) #13

I agree that there must be an easier way but I'm not seeing it so far. I nearly had it by listing Bodycopy Divs from the current page but there doesn't seem to be a way to exclude the WYSIWYG containers.

 

You could use list_current_asset_id to have a nested Asset Listing look for the children of the divs, then print what type code they are.


(Birdg) #14

Hi,

 

Thanks. Do you mean a second asset list nested inside the first one? Would you mind explaining a bit more?

 

Thanks again,

 

Graham


(Nic Hubbard) #15

Do you mean a second asset list nested inside the first one? Would you mind explaining a bit more?

 

Yes, it is an extremely powerful feature.

 

Here is a blog post I wrote a while back: 

 

http://www.zedsaid.com/blog/understanding-the-power-of-list_current_asset_id-in-squiz-matrix

 

Manuals:

 

http://manuals.matrix.squizsuite.net/asset-listing/chapters/list-current-asset-id

 

It is sort of a complex setup, so I didn't want to try to explain it again when it is done in more detail on my blog. But let me know if you have any questions.