Insert text on each page

How does each page gets a menu to the right?

Page 1 of 1

11 Replies - 1889 Views - Last Post: 22 October 2008 - 06:35 PM

#1 Kalkyl  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-October 08

Insert text on each page

Posted 08 October 2008 - 09:54 AM

I would like each page on my site to have the same content in a "frame" to the right, such as a few internal links and a couple of ads.

I don't want to use a real Frame, rather import a piece of html from a separate file, I guess.

What's the smartest way to accomplish this, according to the experts?
Is This A Good Question/Topic? 0
  • +

Replies To: Insert text on each page

#2 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: Insert text on each page

Posted 08 October 2008 - 09:58 AM

put the text in a div and then postion it with your CSS file.

If you use one CSS file for the whole site you just have to place that div on each page and the css will postion it
Was This Post Helpful? 0
  • +
  • -

#3 Kalkyl  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-October 08

Re: Insert text on each page

Posted 08 October 2008 - 10:03 AM

Thanks but I don't wish to put it on every page, that's the point.

Or, wait... you mean I just put the div on the pages, and then keep the text in the common css file?

That sounds like a smart solution. Is that what you mean?
Was This Post Helpful? 0
  • +
  • -

#4 MacAnimeGirl  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 282
  • Joined: 30-September 08

Re: Insert text on each page

Posted 08 October 2008 - 10:17 AM

View PostKalkyl, on 8 Oct, 2008 - 10:03 AM, said:

Thanks but I don't wish to put it on every page, that's the point.

Or, wait... you mean I just put the div on the pages, and then keep the text in the common css file?

That sounds like a smart solution. Is that what you mean?


Make a master page, this is what get loaded. This will have all you sections, which you will create with frames. Make sure to name them. Then have your pages load into those areas. And specify which area each link will load into.

Then you won't have to have the code on every page. The only place it'll be evident will the links themselves.

Did you understand that?

This post has been edited by MacAnimeGirl: 08 October 2008 - 10:18 AM

Was This Post Helpful? 0
  • +
  • -

#5 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Insert text on each page

Posted 08 October 2008 - 10:35 AM

You could also use a server side language like PHP. This would allow you to write a function which returns the menu or ad code and insert it with a call to that function and the best part is, no frames.
Was This Post Helpful? 0
  • +
  • -

#6 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: Insert text on each page

Posted 08 October 2008 - 11:12 AM

No that's not what i meant.

You put the text inside div tags in your html. then you use the CSS to position and style that text where ever and however you like.
Was This Post Helpful? 0
  • +
  • -

#7 Kalkyl  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-October 08

Re: Insert text on each page

Posted 08 October 2008 - 11:17 AM

I want to re-use the same text on each page without having to update all pages when that text changes. And I don't want frames.

So I guess I'll have to go with the server side script then? I had a feeling this could be done with CSS.

Thanks for your replies, all of you!
Was This Post Helpful? 0
  • +
  • -

#8 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Insert text on each page

Posted 08 October 2008 - 11:18 AM

View Postjjsaw5, on 8 Oct, 2008 - 02:12 PM, said:

No that's not what i meant.

You put the text inside div tags in your html. then you use the CSS to position and style that text where ever and however you like.

I understand what you're saying, but I don't think you're understanding the question.

Quote

I would like each page on my site to have the same content ... import a piece of html from a separate file

It isn't about making it look the same, it's about having the same content on multiple pages without duplicating code, I believe. Like having a menu, header and footer content created from an include instead of copying and pasting.


CSS is for styling code, not for inserting it.

This post has been edited by William_Wilson: 08 October 2008 - 11:19 AM

Was This Post Helpful? 0
  • +
  • -

#9 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: Insert text on each page

Posted 08 October 2008 - 11:24 AM

View PostWilliam_Wilson, on 8 Oct, 2008 - 01:18 PM, said:

View Postjjsaw5, on 8 Oct, 2008 - 02:12 PM, said:

No that's not what i meant.

You put the text inside div tags in your html. then you use the CSS to position and style that text where ever and however you like.

I understand what you're saying, but I don't think you're understanding the question.

Quote

I would like each page on my site to have the same content ... import a piece of html from a separate file

It isn't about making it look the same, it's about having the same content on multiple pages without duplicating code, I believe. Like having a menu, header and footer content created from an include instead of copying and pasting.


CSS is for styling code, not for inserting it.



I apologize William, that was not directed at you.


I should have quoted the post i was responding too.
Was This Post Helpful? 0
  • +
  • -

#10 Kalkyl  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-October 08

Re: Insert text on each page

Posted 13 October 2008 - 02:05 PM

Okay, I solved it with ASP. That was really smooth. Thanks for the tip.
Was This Post Helpful? 0
  • +
  • -

#11 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Insert text on each page

Posted 13 October 2008 - 02:14 PM

If you're using classic ASP just use an Include File, then all the text for your navigation resides in a single file. If you're using ASP.NET use a Master Page :)
Was This Post Helpful? 0
  • +
  • -

#12 mrloserskid  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 125
  • Joined: 30-June 08

Re: Insert text on each page

Posted 22 October 2008 - 06:35 PM

i would just use a java frame.
its faster for slower internet connections.
this way they dont have to load the same info twice.
its hard to do this using just notepad i would use dreamweaver or a program like it.
hope it helps :) :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1