How does the the head design area work

How does the the head design area work - <MySource_AREA id_name="head" design_area="head" />
I wanted to added some code within the <head> tag of the main parse file but made available to just one of its customisations. I don't know how to link this design area to a standard page with the code I want to add. Can I is use the "nested_content" design area instead within the head tag (set to raw html)?

The HEAD design area is used by assets to inject CSS and JS into the design at a place of your choosing. It is most commonly used by the Calendar.


If you want an area in your design that you can edit using an asset rather than editing the parse file, you'll need a nested content design area. The DIVs on the page being nested should have their presentation type set to Raw HTML and you should probably use the Raw HTML editor for them.

I am currently using a nest_content area to get a javascript file into my header but I am having validation problems due to div markings in my header.


Can you explain a bit more about how this 'injection' happens?



EDIT: Solved the validation problem but am still curious for more instructions on how to use the head design area.

[quote]I am currently using a nest_content area to get a javascript file into my header but I am having validation problems due to div markings in my header.


Can you explain a bit more about how this 'injection' happens?



EDIT: Solved the validation problem but am still curious for more instructions on how to use the head design area.[/quote]



Hey Rachel



Most Implementers prefer the flexibility of using a nested design area and referring to a standard page asset ( divs set to RAW HTML as per Gregs comments) as an alternative to the use of head design area, which means they can avoid editing the parse file directly and just deal with customisations when required. Like many things with MySource Matrix, there is usually more than one way to achieve the desired results.

The HEAD design area is only used by asset types. You can't inject content in there yourself.

Still not quite understanding how to use it, so here's a scenario. I have a custom form and I want to use css to style the form layout. Can the custom form asset type use the head design area?

No. You never get to decide what goes in that design area's content. The assets themselves put styles in there if told to do so by the PHP developer that built them. It's just a tag where you can tell an asset to put styles if it supports that feature. Calendar makes use of this as it provides a lot of default CSS.

Ah, okay, thanks. :slight_smile: