ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

New here

June 05, 2012 10:45am

Subscribe [3]
  • #1 / Jun 05, 2012 10:45am

    vw000

    482 posts

    Hi im very new to EE, just a few hours on testing. Yes im reading a book on it and I do know my way around HTML, PHP, CSS, Javascript, and other stuff.

    What I don’t know is how to start my structure in EE to import my current site.

    Does javascript code go into channels or templates? How about CSS?

    Thanks guys

  • #2 / Jun 05, 2012 11:50am

    Rob Allen

    3114 posts

    Hi Nibb

    First of all you probably need to look at the content on your existing site and determine what content structure you have. Sort out what you have, eg articles, blogs, galleries and so on, the chances are you might need to set up corresponding Channels in EE to hold your different types of content.

    Next look at the data structure - eg a news item might need to be split into several components such as Title, Summary, Story etc. These will form the Channel custom fields that you need to build.

    Javascript - you can store JS files as EE templates but for efficiency it’s usually best to store them as static files, eg in a folder on your site such as /assets/js

    CSS - again you can run as EE templates or use static CSS files stored on your site somewhere like /assets/css.

  • #3 / Jun 05, 2012 12:00pm

    vw000

    482 posts

    Hi, thanks for the reply. Actually I made my first forum posts here:
    http://ellislab.com/forums/viewthread/218619/

    Where I talk a bit about my current structure.

    Again for your posts and most tutorials I read they all assume you have a blog and a news article. Websites are allot more then just news or blogs. Everyone uses the news and articles as examples which ok but I though EE was more than just a blog. Yes I have news as well on the site but im not going to handle this with EE. I want EE to handle my websites content or webpage, not my news, blog, etc for now.

    My current .js and .css are all in files right now, minized and all in 1 file if possible to speed up website loading. Website performing is something I care allot so I had second toughs about actually using EE which loads all from a database. So based on your reply I should leave them like that for performance wise correct?

    Im just looking into what im suppose to be putting inside EE. I understand that its all in a database so yes, it makes sense not to store everything in a SQL database, as the performance would be terrible not to mention a single point of failure, not database and the whole is down…

    Im just looking a way to know what things need to go into EE and what does not make sense to put into EE, should not or at least its not common in terms that nobody does it.

    So based on your reply I think images, css, javascript should not be in there. All loaded directly from the servers with links, is this correct? Just like its working currently then.

    So what should go into EE for better management? HTML snippets, php codes includes I use regular in some pages and HTML output? If yes, this would go into templates or channels? I have a hard time figuring out for what I would use channels as the only one editing the site is me.

  • #4 / Jun 05, 2012 12:24pm

    Rob Allen

    3114 posts

    Again for your posts and most tutorials I read they all assume you have a blog and a news article. Websites are allot more then just news or blogs. Everyone uses the news and articles as examples which ok but I though EE was more than just a blog. Yes I have news as well on the site but im not going to handle this with EE. I want EE to handle my websites content or webpage, not my news, blog, etc for now.

    I think “news” and “blogs” are used as examples because they are the easiest to get to grips with! You’re right in saying that EE is more than blogging, once you get stuck in you can build some very complex content structures without the need for addons, but it’s always best to start with the basics.

    My current .js and .css are all in files right now, minized and all in 1 file if possible to speed up website loading. Website performing is something I care allot so I had second toughs about actually using EE which loads all from a database. So based on your reply I should leave them like that for performance wise correct?

    Yes using external JS and CSS is better for performance overall.

    So based on your reply I think images, css, javascript should not be in there. All loaded directly from the servers with links, is this correct? Just like its working currently then.

    Yes 😊
    Images are stored as normal files wherever you choose (like /images/uploads) but are referenced via the database so they can be integrated into your content.

    So what should go into EE for better management? HTML snippets, php codes includes I use regular in some pages and HTML output? If yes, this would go into templates or channels? I have a hard time figuring out for what I would use channels as the only one editing the site is me.

    Templates and content

    Templates are for your document structure, you can “embed” templates (as you do for “includes”), or if you want to be more efficient use “Snippets” which can contain chunks of code. Unless you’re doing something exceptional you don’t usually need to use raw PHP in EE templates.

    Channels entries are where you store your actual content, whether that’s a simple blog post, or “data” that’s called into a template to create a page of information. Each Channel can have any number of custom fields to hold data.

  • #5 / Jun 05, 2012 2:56pm

    vw000

    482 posts

    Thanks again for the reply.

    So images, even uploaded are never stored into the DB only referenced correct? That makes sense, the last thing I want is getting images from a SQL database which are actually stored and generated from the database. Vbulletin for example has this option but I don´t like that, and its recommended to store images as file in the server. I guess the same is true with EE.

    Ok, I will use templates as my php includes then like you explained. Since I will not including this anymore via PHP but with EE you are right, there is no need for PHP here as I would be inserting the head, footer, etc via EE.

    So basically I would be including a template inside a template? Is this correct? How deep can this go?

    Now im a bit confused about something in particular. I know everyone can go with a different approach in their design structure but some things are just common sense. Just like you said CSS and JS should be loaded from the server (the same I imagined from day one) on the book I purchased from Amazon “Building Websites with ExpressionEngine 2” from Leonard Murphy, in his example he seems to put everything inside templates. He basically says on one part, open the style.css file, copy all the content and paste it into the template. When I was reading this my mind went to Wow, wait a minute, now the database and EE is generating every single bit of code when rendering the page, this would be performance wise awful, slow and probably a bad idea.

    Then your reply here confirmed what I thought but then when I think about it, what is the difference between putting a simple text content in a template or a CSS or Javascript code in it? Nothing. They are all texts, so it should make no difference to EE do display 100 lines of text like this post, or 100 lines of CSS or JS since they all rendered on the end by the browser. Please correct me if im wrong here.

    So which one is it then? If you think about it, text is text, and its the browser that generates the output, so it should not make a difference what is on the template. I mean, even if you load the css and js externally on a file directly on the server, the whole template that contains the page structure is actually already in EE so its already in a database.

    So if the HTML of the site which contains the code has something like this in there:

    <link rel="stylesheet" type="text/css" href="http://www.example.com/default/css/style.css" />

    Yes, its loading the file externally, but that same line is actually or would already be in a EE template already, so that one is already generated from the database, so what difference would it make if the whole style is also in a template? Text is text, let it be content or some instructions which tell the browser to do something.

    My point is I want to start from day one doing things correctly and not having to rewrite the site again in the future.

    So which one is it? Is there a performance hit or none to having CSS, Javascript and everything else inside EE?

  • #6 / Jun 06, 2012 11:21am

    Shane Eckert

    7174 posts

    Hey guys,

    This is a good discussion.

    I am going to bump this over to the Community Help Forum so you can continue this and get the input of the community.

    Cheers,

  • #7 / Jun 06, 2012 11:24am

    vw000

    482 posts

    Well more like a discussion its a question which im confused about. I never used EE before and this would be my first site im integrating to EE so I don´t know whats common procedure.

    So should CSS and javascript go into EE? Are there any technical documentations or papers on this and performance?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases