SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    E-business guru Eirik's Avatar
    Join Date
    Nov 2000
    Location
    Oslo, Norway
    Posts
    413
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys,

    I posted this question about a week or two ago, but noone has yet given me a reply, so I'm trying again. The reason why I keep nagging on about this is that I'm afraid I'll do something terribly stupid unless I get this question answered.

    I'm currently re-doing my site with a PHP/MySQL backend, and have learn an awful lot of things in the past couple of months. The main reason why I need a database driven site is because of all the articles at my site, so I've made a couple of tables for the articles in the database (Articles and Chapters) where all the article information is stored.

    I've also put the layout of the page in a separate template file. So far, so good I hope.

    However, the problem encounters when I start to work on all the other pages that are not articles. I can use the template for these files too, of course, but since the layout of the content is slightly different than from the articles (no author among many other things) I can't store this information in the Articles and Chapters tables.

    Also, I'm thinking that I need some way of searching the content of these documents later, so I don't want to define the content of each page in the PHP script itself.

    An obvious solution seems to be to make a very simple "Content" table and store the content for all the various pages there. However, that would require a lot of HTML in the table because the layouts differ. Also, as I see it on other site, the URL of the contact page is not site.com/page.php?id=365, but site.com/contact.php if you understand what I mean.

    So, I guess what I'm asking is how you guys are solving this problem as it must be very common. Keeping the content separated for searching while still having pretty descriptive URLs and keeping the HTML out of the content, I mean.

    Thanks so much in advance for any answer that will shed some light on this subject !
    Sincerely,

    Eirik Johansen
    Netmaking AS

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Eirik,

    The way we're handling this on SitePoint is to hard-code the content as a variable in a PHP file, then include("pageLayout.php"), where pageLayout.php outputs that variable in our standard page template. Since our search engine (provided by AtomZ) does not access our database directly, this works just fine for us.

    If we wanted to store the content in the database, we'd likely use a special database table to store the content for those 'other' pages, as you suggest in your message.

    Basically you're on the right track! I can't think of anything you're missing!
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  3. #3
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm.. a better and easier way would be to.. create a template file... and instead of assigning variables to the html snippet..use html comment tags... and then fopen the file and explode it... this is far easier to edit since you can see the entire page at once, and is editable in any WYSIWYG editor..
    i dunno...

  4. #4
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alternatively use a proper template system - phpLib has an excellent template class. Check these out:

    http://www.phpbuilder.com/columns/david20000512.php3
    http://www.devshed.com/Server_Side/P...Lib/print.html

  5. #5
    E-business guru Eirik's Avatar
    Join Date
    Nov 2000
    Location
    Oslo, Norway
    Posts
    413
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Kev,

    Actually, the way your describing was just what I was about to do, templates included.

    I do, however, still got one concern. If I decide to use Atomz like you guys (which I very well might do) how will the engine know of all the articles. I mean, no matter how great it is, it can't index all the articles guessing all the article indexes and so on.

    Do you manually index all the articles with the search engine, or am I missing something here?

    Thanks again !
    Sincerely,

    Eirik Johansen
    Netmaking AS

  6. #6
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it's like all search engine's in that it indexes pages by following links. If you have a page somewhere on your site that listss all of your articles (with links to each one) the atomz spider will be able to locate all of the articles by following links from that page.

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Correct! For search engine friendliness, you should also try to ensure that the URL's to the content you want to have indexed do not use query strings. You'll notice that a couple of months ago, SitePoint's articles moved from a article.php?aid=article&pid=paragraph URL system to a article.php/article/paragraph URL system. The method for doing this was discussed at length elsewhere in these forums.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  8. #8
    E-business guru Eirik's Avatar
    Join Date
    Nov 2000
    Location
    Oslo, Norway
    Posts
    413
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Kev,

    Since I did that from the start (use /'s instead of query URLs) I guess I'm on the right track. I signed up for Atomz yesterday, and it successfully indexed my whole site, all articles included. I'm so releaved !

    Thanks you guys for all your help !
    Sincerely,

    Eirik Johansen
    Netmaking AS

  9. #9
    Idea Developer
    Join Date
    Sep 2000
    Location
    Bethlehem, PA
    Posts
    521
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how do you use /asda/asdasd instead of queries?

  10. #10
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check out my post on doing search engine friendly URLs here:

    http://www.sitepointforums.com/showt...ngine+friendly

  11. #11
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Washington State
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


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
  •