Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Intro on one page - full story on another - one update?

    Hi,

    I'm new to these boards - came across it in seach for an answer to my current problem.

    I'm developing a website and on the front page I want a section that has "introductions" to extended news stories on another page and only having to update once.

    So basically...

    (front page section)
    Date
    Short intro
    Click here to read more link...

    Date
    Short intro
    Click here to read more link...

    Date
    Short intro
    Click here to read more link...

    (News page)
    Date
    Extended story

    Date
    Extended story

    Date
    Extended story

    and only updating the news page.

    I have no idea how to go about this.

    Help?? thankyou in advace

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,466
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    When you click on the "short intros", do they all then go to the same
    page? (the full story page)? or does each short intro go to a full story
    page that's only for that particular short intro?

    And you won't be adding or editing stories?

    =============================

    Answer those questions and also look into this as a method to display
    stories and easily edit them.

    1) Change the extension of your HTML pages to .php
    (example: index.html would now be index.php )

    2) Use Notepad to create text files.
    Name them something like:
    news1_intro.txt news1_full.txt
    news2_intro.txt news2_full.txt ... etc.

    3) Upload those text files into the same directory as your .php pages.

    4) Inside your .php pages, use this code to display your text files:
    <p><?php include 'news1_intro.txt'; ?></p>
    <p><?php include 'news2_intro.txt'; ?></p>

    What's happening is that whenever a "php include" is executed, it
    inserts the contents of whatever text file you're specifying.

    How it's displayed depends on your HTML ... or if you use CSS.
    You can format the paragraphs however you want.

    So now, you only need to edit those text files and not your webpage.
    You can change the text files whenever you want.

    Inside all of the "intro" text files, you'll have the link to the other page(s).
    Of course, you'll need to determine if you're going to have separate
    pages for each story?

    Example ... say this is: "news4_intro.txt"
    ===================================
    More people will be vacationing at the coasts
    this year than ever before.
    <br><a href='nextpage.php'>more ...</a>
    ===================================

    The link is actually put into the text file, and will
    appear with the text paragraph.

  • #3
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    mlseim is on the right track but as you say you only want to update the article (as opposed to a preview file as well), I'd say look into using the substr() function in PHP (which would allow you to pull the 1st 100 characters (or however many you wanted) from the article to use as an intro).

    Edit: Just found this which looks like it could help - http://www.fundisom.com/phparadise/p...marize_article
    Last edited by mark87; 08-24-2006 at 07:25 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
    •