Styles and scripts directly in templates?
3 posters
Page 1 of 1
Styles and scripts directly in templates?
Simple question, is it okey to have style and script directly in template itself?
I was thinking, that if I put a script inside the template instead of having it applied to ALL PAGES this would boost page loading. Same with styles. I wonder if there are any drawbacks of doing so? I guess general style and script settings should be used when changes are wanted for elements in every forum page....
I was thinking, that if I put a script inside the template instead of having it applied to ALL PAGES this would boost page loading. Same with styles. I wonder if there are any drawbacks of doing so? I guess general style and script settings should be used when changes are wanted for elements in every forum page....
Last edited by Kami-sama on December 20th 2017, 9:17 pm; edited 1 time in total
Re: Styles and scripts directly in templates?
Hello there is no real problem with it as long as you don't over do it.
If you add a lot it may slow things down a lot but little codes are fine.
Only real problem is if we have updates them codes may not work and it will not show up on our tools if we need to help you fix the problems, or some updates may not work due to your changes.
If you add a lot it may slow things down a lot but little codes are fine.
Only real problem is if we have updates them codes may not work and it will not show up on our tools if we need to help you fix the problems, or some updates may not work due to your changes.
Re: Styles and scripts directly in templates?
But if a template layout is adjusted anyways it should not be a problem?
In your opinion, what is better, considering that template layout is adjusted either way. Is it better to have adjusted layout style and script together or separately?
In your opinion, what is better, considering that template layout is adjusted either way. Is it better to have adjusted layout style and script together or separately?
Re: Styles and scripts directly in templates?
it's always better to code them together so its faster loading and it makes it easier to changed codes when needed.
Re: Styles and scripts directly in templates?
I do agree. Was only wondering if there would be anything bad doing so. Cool.
While adding style is straightforward. The script I noticed is slightly different.
Why is this needed in the template:
While adding style is straightforward. The script I noticed is slightly different.
Why is this needed in the template:
|
Re: Styles and scripts directly in templates?
The CDATA thing has to do with XML, I don't know exactly what it means but a google search would probaly help you. It's safe to remove it. Adding JS and CSS in the templates is not necessarily a bad thing. If you have a lot of codes, it's a good idea to add them that way:css that has to do with topics to the topic templates and so on. But if you have few lines of code, you should just add them in a single file.
Guest- Guest
Re: Styles and scripts directly in templates?
Justice™ wrote:The CDATA thing has to do with XML, I don't know exactly what it means but a google search would probaly help you. It's safe to remove it. Adding JS and CSS in the templates is not necessarily a bad thing. If you have a lot of codes, it's a good idea to add them that way:css that has to do with topics to the topic templates and so on. But if you have few lines of code, you should just add them in a single file.
Yeah, I have lots ;D especially style.
That's why I decided to sort it next to templates they are applied to.
CDATA sections in XML. In an XML document or external parsed entity, a CDATA section is a section of element content that is marked for the parser to interpret purely as textual data, not as markup.
Re: Styles and scripts directly in templates?
is this now solved for you as its marked solved by Icon ?
Re: Styles and scripts directly in templates?
Problem solved & topic archived.
|

» Suggestion for Hitskin, Support Uploading of templates with the styles.
» Add new member directly
» Having the forum be directly on my URL
» show posts directly
» Update attachments directly
» Add new member directly
» Having the forum be directly on my URL
» show posts directly
» Update attachments directly
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum