Welcome to WebmasterWorld Guest from 54.196.217.43

Forum Moderators: ergophobe

Message Too Old, No Replies

How can we call a HTML Template and a .txt file containing the text?

Dynamic Pages

     
9:04 pm on Jun 30, 2009 (gmt 0)

New User

5+ Year Member

joined:June 30, 2009
posts: 5
votes: 0


Hello All,

I am stuck with simple logic in mind and trying to find how this can be implemented.

What i am looking for:
Suppose we have a NEWS section in a website that displays the headings only. when we click on the heading, i should be able to somehow call a page (news page template) along with the detail of the news that is stored in a .txt file. This way, i shall not require to create multiple pages.

Any idea how this can be achived?

Thanks
Creativefox

11:26 pm on June 30, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 14, 2008
posts:123
votes: 0


Well a content management system (CMS) could do that with exception that the news content would stored in the CMS database not as a physical .txt file.
12:58 am on July 1, 2009 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8129
votes: 89


You could also do this with some sort of server side include or simply use the PHP auto_prepend directive or a simple PHP script.

[webmasterworld.com...]
[webmasterworld.com...]

[zend.com...]

7:01 am on July 1, 2009 (gmt 0)

Moderator from US 

WebmasterWorld Administrator robert_charlton is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 11, 2000
posts:11309
votes: 163


...This way, i shall not require to create multiple pages.

Why do you wish to avoid multiple pages? If you want your articles to be found via search engines, multiple html pages are almost essential.

A page is the basic unit of optimization, and multiple pages broaden the possible search targeting of a site.

8:23 am on July 1, 2009 (gmt 0)

New User

5+ Year Member

joined:June 30, 2009
posts:5
votes: 0


Thanks everyone...

1. I do not have database structure
2. Server side include can only call an external file within a page - but here i need HREF or Link command that can fetch both a template and a content placed in either html format or .txt
3. I do not require search engines to find my news pages as thats not important. its a corporate website. and secondly i cant keep making pages for every single news!

Any Help?

Thanks

5:36 pm on July 1, 2009 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8129
votes: 89


RE #2 - did you look into PHP auto-prepend as I suggested? That would do the trick.

- the file might be something like /news/mypage.txt
- you could rewrite these to /news/mypage.html or /news/mypage
- then you have an auto_prepend PHP script that parses your news scripts and injects them into your template.

2:36 pm on July 2, 2009 (gmt 0)

New User

5+ Year Member

joined:June 30, 2009
posts:5
votes: 0


Thanks,
I shall look into that and let you know if it works.. meanwhile i welcome more comments, suggestions... thanks
3:43 pm on July 2, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 29, 2002
posts:980
votes: 0


Follow ergophobe's and Robert Charlton's advice :)
4:13 pm on July 2, 2009 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8129
votes: 89


BTW, a belated welcome creativefox. I didn't notice that you were new. So welcome!

It's gotten a bit rusty with age, but you still might find some useful info in the New Member Orientation thread [webmasterworld.com].