Asset contents surrounded by unwanted div tags


(Birdg) #1

Hi,

 

I am relatively new to Squiz Matrix but I understand that Page contents are divided up into blocks that are surrounded by div tags (sometimes two, if using a paint layout) unless specifically told not to (changing them to "Raw HTML" etc).

 

My question is: why is the product like this? It seems very strange. No one wants spurious div tags in their HTML. If they are required for editing purposes, they shouldn't be in the published source code. What purpose do they serve?

 

Also, is there a way to programmatically strip them from the published code?

 

Many thanks,

 

Graham


(Bart Banda) #2

Hi Graham,

I am not sure what the main reasoning behind this was when the product was first developed, but one benefit I can see is that it would force content to get cleared to a new line if it's not surrounded in a block style tag like a p tag. For example, if you add some text to 1 div inside a span, and also in the second div, the default display of it would be all in one line if the default divs didnt surround them.

 

You can set user preferences for the whole system, a specific user group, or just yourself to force each new bodycopy that you create default to raw HTML using the global preferences. http://manuals.matrix.squizsuite.net/system-configuration/chapters/global-preferences#Bodycopy-Container-Preferences


(Birdg) #3

Hi Bart,

 

Thanks for your reply.

 

To me the clearing behaviour is a hindrance rather than a help because there are cases when you do want content side by side (and this should be a decision made by the designer, not the CMS).

 

Thanks for the hint about the preferences but they aren't granular enough in my opinion - we do want the WYSIWYG editor, just not surrounded by div tags. This doesn't seem to be an option within the config available.

 

Do you know whether there is a way to clean the %asset_contents% of them - perhaps with a keyword modifier?

 

Many thanks,

 

Graham


(Nic Hubbard) #4

To me the clearing behaviour is a hindrance rather than a help because there are cases when you do want content side by side (and this should be a decision made by the designer, not the CMS).

 

Thanks for the hint about the preferences but they aren't granular enough in my opinion - we do want the WYSIWYG editor, just not surrounded by div tags. This doesn't seem to be an option within the config available.

 

Maybe you are missing the simplicity of how to fix this issue. Just go to Global Preferences and turn the Default Presentation Type to Raw HTM:

 

Screen%20Shot%202014-01-07%20at%209.00.5

 

Change it and you never have to touch it again.

 

If you want content side by side that it up to you to build it and can easily be done with your own markup.


(Bart Banda) #5

What Nick said, the setting I'm talking about only affects the presentation wrapper of the div, not the div content type. So you will still be able to use the WYSIWYG, but it won't get wrapped in a div by default.

 

Wouldn't you want to put side by side content in the same content div anyways? So that when the editor views the content in the editor, it is as close as possible to what will be presented on the front end?

 

Anyways, try that setting and let us know if that solves your problem.


(Birdg) #6

Hi,

 

Ah, OK. That makes sense. We'll give that a go. Thanks for taking the time to explain.

 

:)

 

Graham


(Birdg) #7

Hi,

 

I've tried this and it works fine in the _admin interface but Edit+ ignores it. Is there a way to get Edit+ to do the same?

 

Thanks,

 

Graham


(Nic Hubbard) #8

I've tried this and it works fine in the _admin interface but Edit+ ignores it. Is there a way to get Edit+ to do the same?

 

This shouldn't be the case if you have changed the global setting for this. However, if you have a DIV that you created BEFORE you changed the setting, then it will still be set as a Block-level, which you will need to change to RAW HTML. Any new divs you create will use the new global settings.


(Birdg) #9

Hi Nic, I thought so too but attached is a screenshot of the insert new div popup.

 

[attachment=660:newcontainer.jpg]

 

And here is the Global Prefs screen:

 

[attachment=661:globalprefs.jpg]

 

G

 

  globalprefs.jpg (27.6 KB) newcontainer.jpg (23.9 KB)


(Nic Hubbard) #10

Hi Nic, I thought so too but attached is a screenshot of the insert new div popup.

 

Hmmm. And if you try the exact thing in the _admin it honors the Globals Prefs setting?


(Birdg) #11

Hi Nic,

 

Unfortunately yes, in the _admin view it does default to Raw HTML as expected.

 

G


(Nic Hubbard) #12

Hi Nic,

 

Unfortunately yes, in the _admin view it does default to Raw HTML as expected.

 

G

 

I would post a bug. http://bugs.matrix.squiz.net


(Birdg) #13

Ok, thanks for the help.