Standard page assett with css and javascript


(Stephanie Mcdonald) #1

I have a standalone page created offline with css and javascript. 

 

This page is to be pulled into a current site in squiz using an iframe. 

 

I have created a standard page asset and copied in my html

 

I have uploaded my css to the media folder

 

In the most basic way, How do I link to my css stylesheet?

 

I will also need to do the same with the js. 

 

can anyone help?

 

I'm still waiting on my matrix design training!, where all this will be revealed, but for now I need to move on this one...


(Nic Hubbard) #2

You can just create normal link and script tags within your Design Parse file using keywords to print the URL of those assets:

<script type='text/javascript' src="%globals_asset_url:1234%"></script>
<link rel="stylesheet" type="text/css" href="%globals_asset_url:12345%" />

Alternately, you can use the mysource_files path if your assets are linked under your Design file. Take a look at the docs for more info:

 

http://manuals.matrix.squizsuite.net/designs/appendices/appendix-example-parse-file


(Clementoke) #3

You will need to create a design (or at least apply one) http://manuals.matrix.squizsuite.net/designs this tells squiz, where to pick up the css and js files from. You then apply the design to your page which at the moment only displays the bodycopy.

Read the manual in the link and give it a go


(Anthony Barnes) #4

Just a note on this:

 

 

This page is to be pulled into a current site in squiz using an iframe.

 

Iframes can cause difficulties with accessibility & usability. You might consider using other Squiz Matrix asset types like Remote Content or REST assets to bring in information from a url and display it as though it was content belonging to a page within Matrix. Those asset types are more 'advanced' than many so it might make more sense after you have had your training and a bit more of a read through the manuals.