+ Reply to Thread
Results 1 to 6 of 6

Thread: Scripting Template and Design Language

  1. #1
    desmondw is offline x10Hosting Member desmondw is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    4

    Scripting Template and Design Language

    I'm not that familiar with any code structure past HTML and CSS and was wondering what kind of scripting and with what language I should use to have a standard template on my site (such as the same look on every page without rewriting code). CSS is looking pretty good for changing looks globally with one file to edit - but I'm concerned with the content that is static across all pages (background, main links, add placement, etc...). For a reference you can see my site at theexistential.com (still in progress obviously) and just view source - the only thing I have besides the base html currently is CSS.

    Also, I'm trying to get a feel for what kind of scripting languages to use for my site (and what I need). It's hard to do this by using view source on web pages. The site will be a blog - so ideas as far as showing blog posts on a single page via references (instead of manually editting the content everytime I add a post) would be a good start.

    Thanks

  2. #2
    akkudreamz's Avatar
    akkudreamz is offline x10 Sophmore akkudreamz is an unknown quantity at this point
    Join Date
    Jan 2009
    Location
    Jaipur, Rajasthan, India
    Posts
    183

    Re: Scripting Template and Design Language

    have you heard of smarty
    google it and you'll find some tutorials its actually a template engine for php
    most standard sites are built using smarty these days
    as it separates the code from the presentation
    Be safety conscious. 80% of people are caused by accidents.
    My Weblog

  3. #3
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: Scripting Template and Design Language

    I don't use a CMS, as I find them annoying!!

    The scripts I use are in php and very useful for maintaining a corporate feel throughout the entire site.

    As you know, you can use single .css files to control the look across the site.

    In addition, you can also use the <?php include(); ?> function, which is great because you can put your header/ footer or any other part of a page into seperate files and insert them when you want to.

    This not only cuts down replication, but makes life very simple when you want to change a look across the site.

    I wonder if you can change a .css file by using php variables?? Hmm... must look into that!

    The standard way to alter styling depending on a set of circumstances would be to include a different .css file link with a <?php if()....else ?> statement.

    This way, you could load personal preferences for instance, which would load a specific .css file, depnding on the value the if..else statement gets.

    Does this help at all??

  4. #4
    desmondw is offline x10Hosting Member desmondw is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    4

    Re: Scripting Template and Design Language

    Quote Originally Posted by freecrm View Post
    In addition, you can also use the <?php include(); ?> function, which is great because you can put your header/ footer or any other part of a page into separate files and insert them when you want to.
    This is exactly what I want to do. Do you (or does anyone else) have example code I could look at for a reference? I usually learn best by referencing fully written code.

  5. #5
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: Scripting Template and Design Language

    I can't really write out a full code now, but I can give an example. Also, you can try w3schools.com/php if you are learning PHP.

    This is basicly a simplified WordPress "Loop"
    PHP Code:
    <?php
    include('header.php');

    /*
    *
    *Static Data
    *Like News Posts
    **Etc.
    *This would be directly after your navigation, which is in header.php
    *
    */

    include('footer.php');

    ?>
    Header.php (Just filling in what would be there:

    PHP Code:
    <html>
    <
    head>
    <
    title>(Dynamic Usually)</title>
    <!--
    Meta Javascript Here-->
    </
    head>
    <
    body>
    <!--
    Whatever your header is...-->
    <!--
    Navigation-->

    <!--
    Rest of the page is called from index.php--> 
    Note: Header.php can contain PHP, I just used HTML. :P

    The index.php file would contain JUST the page. All the content, sidebars, etc. Sidebars can be included from seperate files by using divisions and include()s.

    Footer.php

    PHP Code:
    <div id=footer>
    Here's your footer
    </div>

    <!--Whatever you need to end the page...-->
    </body>
    </html> 
    Is that good?
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  6. #6
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: Scripting Template and Design Language

    I think thats spot on Neil!

    Desmond, we can't really do full script because we don't know what files you're referencing and what you want contained in them! ;)

+ Reply to Thread

Similar Threads

  1. [OFF][2000 credits] design custom template
    By relisys in forum The Marketplace
    Replies: 6
    Last Post: 08-31-2008, 09:09 AM
  2. Replies: 0
    Last Post: 07-14-2008, 11:31 AM
  3. New Design Studio - CSS Template
    By disturbedart in forum Review My Site
    Replies: 22
    Last Post: 07-02-2008, 05:35 PM
  4. Replies: 2
    Last Post: 12-16-2006, 08:59 PM
  5. vB design and Unique Template for sale
    By Flashgear in forum The Marketplace
    Replies: 7
    Last Post: 10-30-2006, 09:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers