Welcome to Dream.In.Code
Become an Expert!

Join 137,369 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,861 people online right now. Registration is fast and FREE... Join Now!




Insert text on each page

 
Reply to this topicStart new topic

Insert text on each page, How does each page gets a menu to the right?

Kalkyl
8 Oct, 2008 - 08:54 AM
Post #1

New D.I.C Head
*

Joined: 8 Oct, 2008
Posts: 4

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?
User is offlineProfile CardPM
+Quote Post

jjsaw5
RE: Insert Text On Each Page
8 Oct, 2008 - 08:58 AM
Post #2

I must break you
Group Icon

Joined: 4 Jan, 2008
Posts: 1,411



Thanked: 7 times
Dream Kudos: 125
Expert In: HTML, CSS, Database,

My Contributions
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
User is offlineProfile CardPM
+Quote Post

Kalkyl
RE: Insert Text On Each Page
8 Oct, 2008 - 09:03 AM
Post #3

New D.I.C Head
*

Joined: 8 Oct, 2008
Posts: 4

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?
User is offlineProfile CardPM
+Quote Post

MacAnimeGirl
RE: Insert Text On Each Page
8 Oct, 2008 - 09:17 AM
Post #4

D.I.C Head
**

Joined: 30 Sep, 2008
Posts: 132


My Contributions
QUOTE(Kalkyl @ 8 Oct, 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?


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: 8 Oct, 2008 - 09:18 AM
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Insert Text On Each Page
8 Oct, 2008 - 09:35 AM
Post #5

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,013



Thanked: 18 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
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.
User is offlineProfile CardPM
+Quote Post

jjsaw5
RE: Insert Text On Each Page
8 Oct, 2008 - 10:12 AM
Post #6

I must break you
Group Icon

Joined: 4 Jan, 2008
Posts: 1,411



Thanked: 7 times
Dream Kudos: 125
Expert In: HTML, CSS, Database,

My Contributions
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.
User is offlineProfile CardPM
+Quote Post

Kalkyl
RE: Insert Text On Each Page
8 Oct, 2008 - 10:17 AM
Post #7

New D.I.C Head
*

Joined: 8 Oct, 2008
Posts: 4

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!
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Insert Text On Each Page
8 Oct, 2008 - 10:18 AM
Post #8

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,013



Thanked: 18 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
QUOTE(jjsaw5 @ 8 Oct, 2008 - 02:12 PM) *

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: 8 Oct, 2008 - 10:19 AM
User is offlineProfile CardPM
+Quote Post

jjsaw5
RE: Insert Text On Each Page
8 Oct, 2008 - 10:24 AM
Post #9

I must break you
Group Icon

Joined: 4 Jan, 2008
Posts: 1,411



Thanked: 7 times
Dream Kudos: 125
Expert In: HTML, CSS, Database,

My Contributions
QUOTE(William_Wilson @ 8 Oct, 2008 - 01:18 PM) *

QUOTE(jjsaw5 @ 8 Oct, 2008 - 02:12 PM) *

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.
User is offlineProfile CardPM
+Quote Post

Kalkyl
RE: Insert Text On Each Page
13 Oct, 2008 - 01:05 PM
Post #10

New D.I.C Head
*

Joined: 8 Oct, 2008
Posts: 4

Okay, I solved it with ASP. That was really smooth. Thanks for the tip.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Insert Text On Each Page
13 Oct, 2008 - 01:14 PM
Post #11

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,009



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
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 smile.gif
User is offlineProfile CardPM
+Quote Post

mrloserskid
RE: Insert Text On Each Page
22 Oct, 2008 - 05:35 PM
Post #12

New D.I.C Head
*

Joined: 30 Jun, 2008
Posts: 25


My Contributions
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 smile.gif smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/5/08 01:18AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month