I created a multimedia component for css and js and attached these on page Template building block and when I browsed my publish page my css are not going to load how css and js are loaded on publish page.
give me solution?
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI created a multimedia component for css and js and attached these on page Template building block and when I browsed my publish page my css are not going to load how css and js are loaded on publish page.
give me solution?
Try to Use css and js like below in your TBB:
<link href="tcm:xx-xxxx" rel="stylesheet" type="text/css" />
<script src="tcm:yy-yyyy" type="text/javascript"></script>
Please refer to the answer by Nuno Linhares:
Whilst you could (and probably should) argue that neither CSS and Javascript is content and therefore shouldn't be in the CMS, realistically many companies' front-end teams look after these files but are denied direct access to the servers in order to change them efficiently.
The solution we ended up using was "Publish Design Elements", which is part of Will Price's Generic TBBs. You can get it here:
https://sdltridionworld.com/community/2011_extensions/generic-2011-tbbs.aspx
If memory serves correctly, you create a folder structure in your design publication, say 020 Global Design > Design Elements > css > cssimages
and store your CSS as a multimedia component.
Then, in your structure publication, you create structure groups to mirror that, e.g. 040 Global Web > css > cssimages
(creating one structure group for each folder).
Create a single page in the css
folder and pass a parameter to the TBB with the location of the design elements, and it'll take care of the rest.
There are probably more complete instructions in the TBBs, but the key point is that the structure group structure must mirror the folder structure including children.
It's a handy tool.