SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: Alphabet Soup

  1. #1
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Alphabet Soup

    A website usually has basic sections such as a header, navigation, footer, and content area. Using XHTML and CSS, you create the layout of these areas. This code has to be repeated on each site page. If, for example, you want to add a catergory in your navigation, you have to change the XHTML on each page. I know that Dreamweaver templates allow you to create a template for certain areas such as navigation. This means you only have to make one change to the template, instead of changing each individual page.

    This is the point where I would like some help. If you don't use Dreamweaver, what technology or method do you use to create a template. Obviously, large sites must have some way to do this to save labor. I'm just lost in the alphabet of JavaScript, PHP, etc., when it comes to designing what I think you call a dynamic site. Thanks.

  2. #2
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Basically the easiest way is using something called server-side includes, it allows you to embed files inside other files, all serverside languages support it in some form (PHP / ColdFusion / ASP / ASP.NET / JSP / etc), it is a single line of code which tells the server... stick this file at this position, then commense processing. Most people use server-side includes to group common elements within a website like the ones you mentioned so one change to the file which is included means all the files which include it get all the changes instantly.

  3. #3
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After a pointer in the right direction, I found this tutorial that talks about using PHP to maintain a menu or navigation section. www tizag dot com slash phpT slash include dot php I didn't realize PHP pages could include XHTML code.

  4. #4
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    DuckWrangler, all serverside languages add to (x)HTML, they are not a replacement. The point of languages like PHP are to script based on a set of commands which are processed from the website before they are rendered, they do not remove the need for structural markup languages like HTML

  5. #5
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there an article or tutorial that you would recommend on this topic? Thanks.

  6. #6
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Do you mean on the subject of server-side includes? If so that Tizag article is as good as any.

  7. #7
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I looked at the first four chapters of the Sitepoint book on PHP and MySQL. I understand the concept of pulling information from a database and plugging it into a website. What do you need to learn to go beyond building a website with just CSS and HTML? What's the next skill that I need to develop? What do I need to know in SSI "stuff" to reproduce Dreamweaver template functionality? It's hard to ask the right question when you don't know the lay of the land. Sitepoint needs something like a shopping mall map. You are here. Over here we have CSS. Over there are the SSI languages, PHP, ASP, etc. Thanks.

  8. #8
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    They do have a map of sorts here >>> http://www.sitepoint.com/books/library/

    However in respect to SSI, it is extremly easy to use, all includes are is that single line of code which imports an external file into the document, you don't need to learn an entire language to use them, you just ensure the page in question has the .php or .aspx extension (whichever is required for the include you use) then you place the line of code where you want the file containing the source code to be included...

    This may be of use: http://www.yourhtmlsource.com/sitema.../includes.html

  9. #9
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Or use an editor like Notepad++ which can do find-replace over multiple files.

    Open all the site pages in this editor at the same time, then do a find / replace to replace one navigation item with two navigation items, and select In all open files. Works a treat.

  10. #10
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ran across a helpful tool. Do you want to know what technology is under the hood of a website? sitonomy dot com will analyze a link that you submit and tell you if the site is using WordPress or PHP or JavaScript, etc.

  11. #11
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Dr John View Post
    Or use an editor like Notepad++ which can do find-replace over multiple files.

    Open all the site pages in this editor at the same time, then do a find / replace to replace one navigation item with two navigation items, and select In all open files. Works a treat.
    That isn't really logical is it? Why would you want to use a mass find and replace method when you could use SSI's which do the task effeciently and you do not need to worry about the issues with accidently missing something. Quite frankly your advice is counter-productive and over complicating the issue.

    DuckWrangler, I have used that website in the past and it can be very useful if you wan't to understand how something was built

  12. #12
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AlexDawson View Post
    That isn't really logical is it? Why would you want to use a mass find and replace method when you could use SSI's which do the task effeciently and you do not need to worry about the issues with accidently missing something. Quite frankly your advice is counter-productive and over complicating the issue.
    Because some hosts don't let you use SSI...

    I've had sites where there were only five or six pages with the client adamant that that's all he/she will need, then six or nine months later they want to add one more page, and this method is perfect for such things.

    Perhaps I should add that I've used SSis when using PHP to build a site. But not all sites need PHP and occasionally, as we all know, clients change their minds.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •