Coming back from a l-o-n-g hiatus with PHP, and hoping you guys can help me get my head back into coding!

Am building a website that is content-oriented (e.g. LA Times, Newsweek, Wall Street Journal).

Since disappearing, I have created two templates - from scratch - that look really good. One is for my home page (3-columns), and another (2-column) that will apply to most other pages.

The problem is that they are hard-coded in HTML/CSS. :o

What is the best way to take these hard-coded webpage templates and use PHP to make them dynamic??

By this I mean that if I have 15 articles using my "Home Page Template", I don't want to have 15 copies of my home page!

I'm probably not ready to store content in a database yet, but it would be nice to have an easier way to change content!

How can PHP help me out?

Debbie

    i would look at using one of the cms's, unless you really want to role your own.

      dagon;10976592 wrote:

      i would look at using one of the cms's, unless you really want to role your own.

      Not interested in using other people's software.

      I am interested in getting help with tackling the problem in my original post.

      Thanks,

      Debbie

        php is some else's software, so there's always a limit so, maybe some else can help but its the type of question that gets the response from of "how long is a piece of string" it sounds like you need to properly scope the project.

          dagon;10976598 wrote:

          php is some else's software, so there's always a limit so, maybe some else can help but its the type of question that gets the response from of "how long is a piece of string" it sounds like you need to properly scope the project.

          Sarcasm??

          I asked how I use PHP to take a static HTML page and swap in and out content in my Middle Column.

          Saying, "It sounds like you need to properly scope the project." is a pretty obnoxious response. :rolleyes:

          Debbie

            your seeking template's witch comes from the use of a template engine... but in a way dagon is correct if you did a simple search you could have located the information your seeking. to go more dynamic look into php & mysql or a framework but must have the basics down first.

              jgetner;10976610 wrote:

              your seeking template's witch comes from the use of a template engine... but in a way dagon is correct if you did a simple search you could have located the information your seeking. to go more dynamic look into php & mysql or a framework but must have the basics down first.

              If I looked long enough on the Internet, I would have never had to join PHP Builder...

              I'm trying to learn how to do this myself, not go use someone else's software

              Debbie

                you don't have to use a template system or a premade cms or framework - and if it's just a block of text plus a title that you need to be dynamic, then you can fairly easily roll your own as a beginner project

                but..
                you will probably find that you want it to do much more as you go on (add pictures, style text etc) and there are a lot of potential pitfalls e.g. security

                so it really is best to find a good tutorial first to use as a starting point and then come back here for specific questions

                  cretaceous;10976676 wrote:

                  you don't have to use a template system or a premade cms or framework

                  Good, because the goal is to learn PHP and not let someone else build my dream for me!

                  - and if it's just a block of text plus a title that you need to be dynamic, then you can fairly easily roll your own as a beginner project

                  but..
                  you will probably find that you want it to do much more as you go on (add pictures, style text etc) and there are a lot of potential pitfalls e.g. security

                  so it really is best to find a good tutorial first to use as a starting point and then come back here for specific questions

                  Well, if anyone wants to truly help me, I can be very specific with my questions. Just understand that it is a dialogue which means things build on each other.

                  I will gladly describe what I am trying to do if anyone wants to help out.

                  Debbie

                    though I do not know Dagon at all, he is knowledgeable
                    defining a starting point is important and how can we know what you may or may not have considered?

                    also it's good, for future knowledge, not to specify the terms of receiving information,
                    it is, as you say, a dialogue

                      cretaceous;10976679 wrote:

                      though I do not know Dagon at all, he is knowledgeable
                      defining a starting point is important and how can we know what you may or may not have considered?

                      also it's good, for future knowledge, not to specify the terms of receiving information,
                      it is, as you say, a dialogue

                      What's the incentive to tell more based on those last two responses?

                      It's not a good way to welcome someone by suggesting they go use software (on a website that is programming based). It implies that I'm so helpless that only a finished product could help.

                      Likewise, saying, "you need to learn how to scope a problem" won't endear anyone to you either.

                      How about, "Would love to help you, but could you explain a little more what you meant in your original post?"

                      Debbie

                        I apologise, but I found the question so broad as to be meaningless, I'm use to getting properly scoped projects.

                        I know this is not work, so in fact i would know less of the basics, than for any work project. i find your question like telling a doctor "I hurt" and expecting a full diagnosis and treatment regime.

                          dagon;10976685 wrote:

                          I apologise, but I found the question so broad as to be meaningless, I'm use to getting properly scoped projects.

                          I know this is not work, so in fact i would know less of the basics, than for any work project. i find your question like telling a doctor "I hurt" and expecting a full diagnosis and treatment regime.

                          I thought it was pretty clear, but let me try again... (Oh the extra typing!!)

                          I am building a website - from scratch thank you very much! - that will be content heavy. It is similar to a newspaper.

                          Here is a link to a really crude mock-up that will suffice for my questions here...

                          Debbie Test Page

                          The $10,000 question is this...

                          As it stands, I have a nice "template" that represents what most pages would look like on my website. The problem, however, is that it is hard-coded.

                          The Header, Left & Right Columns, and Footer are basically static, however the Middle Column will change frequently.

                          So, as it stands, if I have 15 different articles, I need to have 15 hard-coded HTML/CSS pages all which contain 80% of the same code.

                          That is a maintenance nightmare!

                          Let's say a user looks at the main menu and chooses Travel>>Tips. In the middle column, I want a "sub-page" to appear called "TravelTips.html" (or whatever).

                          Then if the user goes to Opinion>>Double Dee, the middle column should display "Debbie's Thoughts.html"

                          I have a programming background, and even knew PHP and MySQL in a former life. But its been so long as to be useless.

                          My goal right now is to get my website up and running, with enough content to be presentable, and from a design standpoint, want something that is reasonably maintainable!!

                          Having to repeatedly modify hard-coded HTML/CSS pages is not practical. And building some objected-oriented, 10,000 class/page website is fantasy.

                          The most practical solution might be just using "includes" for now, but YOU GUYS are the supposed experts. (I'm just a mere mortal!)

                          I have seen lots of people try to have a series of "includes" (i.e. Header, Left Column, Right Column, Footer, etc) but that seems bass-ackwards?!

                          From a conceptual standpoint, I would think you could take one of my completed HTML templates, wrap it in PHP, and the "include" the changing part (i.e. the article)?!

                          Where I can really use help is at the conceptual/abstract level. (If I just wanted help with PHP, I'd go read the manual.)

                          I guess my question(s) are as much "design" and "architecture" as they are anything.

                          The good news is that solving my simple problem(s) for this basic website should be cake for you guys.

                          Hopefully that is more clear!

                          Sincerely,

                          Debbie

                          P.S. I DO plan on going back and learning PHP and HTML after my website is up and running and making $$$. But for now, the goal is to get things up and running soon.

                          I have a nice web design and tons of content, I am just realizing that hooking everything up and using an approach that is easy to manage is a little tricker than I thought!

                            as you are clearly not a beginner and aren't keen on an "include" structure (which would be what comes to mind from your initial comments) you definitely do want to use a database

                            and since you understand code you will be able to get through it quite easily - in fact you might well find the most tiresome thing is the html - but it's still good to have a decent reference to go from (book or tutorial) as you get back into this stuff

                              Write a Reply...