Page Properties in master pages (Full Version)

All Forums >> [Web Development] >> Expression Web Help



Message


tgt -> Page Properties in master pages (8/8/2007 11:17:34)

I figured out how to make the page properties editable in DWT's but am having a heck of a time accomplishing this feat in a master page.

I have the description and keywords editable within the contentPlaceHolder and I can type in a description and keywords... but as soon as I close the page they are GONE!

I have tried several fixes and am completely stumped.

What is the secret code and where the heck do I put it?

Thanks so much.




WantToLearn -> RE: Page Properties in master pages (8/8/2007 11:57:14)

Do you have a contentPlaceHolder in the HEAD of your master page?





tgt -> RE: Page Properties in master pages (8/8/2007 12:17:40)

I have this:

<head runat="server">

THEN A BUNCH OF STYLES and this:


<title>MY WEBSITE NAME</title>
<asp:ContentPlaceHolder runat="server" id="head">
</asp:ContentPlaceHolder>
</head>

Is this good?

Thanks.




WantToLearn -> RE: Page Properties in master pages (8/8/2007 12:48:09)

quote:

ORIGINAL: tgt

I have this:

<head runat="server">

THEN A BUNCH OF STYLES and this:


<title>MY WEBSITE NAME</title>
<asp:ContentPlaceHolder runat="server" id="head">
</asp:ContentPlaceHolder>
</head>

Is this good?

Thanks.


Yes.

Now, does the child page of the master have a content control that is linked to the head contentPlaceHolder like so?

<asp:Content id="Content2" runat="server" contentplaceholderid="head">
<meta name="keywords" content="sample" />
<meta name="description" content="sample" />
</asp:Content>




tgt -> RE: Page Properties in master pages (8/8/2007 13:20:49)

Nope.

I am not sure where to place this in the master page either. Other than the "head" area, I only have one other editable region in my page - a "content" area in the main box of my page.

Should it read like this on my page?:

<asp:Content id="Content" runat="server" contentplaceholderid="head">
<meta name="keywords" content="sample" />
<meta name="description" content="sample" />
</asp:Content>

I tried to place this on my master page and it shut down the software completely! Guess I am not placing it in the correct area?

Thanks again for your help.




WantToLearn -> RE: Page Properties in master pages (8/8/2007 14:01:31)

That code needs to be placed in the content page (the "child" of the master, not the master itself).

See the code samples below:

THE MASTER PAGE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Master Language="VB" %>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Untitled 1</title>
 <asp:ContentPlaceHolder id="head" runat="server">
 </asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
	<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
	</asp:ContentPlaceHolder>
</form>
</body>
</html>


THE CONTENT PAGE
<%@ Page masterpagefile="Untitled_1.master" language="VB" title="Untitled 1" %>
<asp:Content id="Content2" runat="server" contentplaceholderid="head">
 <meta name="keywords" content="sample" />
 <meta name="description" content="sample" />
</asp:Content>

<asp:Content id="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">
 page content here
</asp:Content>








tgt -> RE: Page Properties in master pages (8/8/2007 18:12:23)

This is what my child pages look like - after I have clicked on the "add custom content" tab in my content area:

<%@ Page masterpagefile="MASTERS/archive.master" language="C#" title="MY WEBSITE" %>
<asp:Content id="Content1" runat="server" contentplaceholderid="content">
<p></p>
<table cellpadding="0" cellspacing="0" class="style3">
<tr>
<td style="width: 50%; text-align: left"> </td>
<td style="width: 50%; text-align: right"> </td>
</tr>
</table>

</asp:Content>

Yes, there is a table in there - down at the bottom for me to add chapter navigation individually...

I think I have probably messed up my master so much now that I should start over (ugg!)

Am I to understand that I need to paste that bit of "head" place holder onto every page individually? (This would suck.)

Of course, on this section of my web these two meta tags (description, keywords) are not even needed as these pages have a robot (noindex, no follow)... But for most of my pages on my other websites, I want the keywords, etc.

Do you know where I can go to hire someone to make a simple css template? I know exactly what I want, but as hard as I try, I can't build it in css. None of the ones included in EW will work for me. I have spent three days working on a design and could never get it to work, read Cheryl D. Wise's book and EW for Dummies. Finally, I went back to a table design, which is exactly what I am supposed to be avoiding right?

I'm so frustrated now, I could scream. Thanks for your help. Again.




WantToLearn -> RE: Page Properties in master pages (8/9/2007 9:38:09)

You need to ask yourself, "Why do I need a css template?" If the answer is because your client or boss demands a CSS layout, then you had better learn it or get one. But if it's just because you've heard that css layouts are better and that table layouts are evil, you need to examine the other side of the story and possibly save yourself all that frustration. Table layouts are not evil; Google and many, many other high traffic, high profile websites still use table layouts. Kevin Yank, a respected web professional and editor of SitePoint.com, said it best in his recent newsletter:

quote:


HTML tables enable web designers do one thing very well: design with 2D grids. And let's face it: if one thing has remained constant in web design over the past ten years, it's that designs are commonly based on 2D grids.

Without tables, HTML content is designed to only stack vertically, one block on top of the other. Grids require the horizontal and vertical stacking that tables can provide. You can emulate this to some extent using CSS floats, but that's not what floats were designed to do; using them this way tends to produce a lot of unexpected problems and trigger obscure browser bugs.
The biggest reason given for avoiding HTML tables for layout is because table-based layout is misusing a feature intended for another purpose. We believe the same logic should apply to CSS floats: using floats for grid layouts is, to some extent, misusing CSS.

But we can argue ideals all day—the practical reality is that tables do some things much better than CSS.
For one thing, tables can give you columns that stretch to accommodate their contents' width—automatically. In CSS, the closest thing you can do is specify column widths in ems, which are imprecise, and also force you to update your CSS every time the contents of the column change.

Another point in favor of tables is that my mom and dad can understand them. My parents will never "get" CSS grid layout techniques like negative margins and faux columns, nor should they be expected to.

Our opposition will no doubt tell you about accessibility problems caused by layout tables. Well, the Web should be universally accessible to publishers too, not just readers. We're not saying that you should be using tables for layout, just that some people cannot yet be reasonably expected to lay out their sites with CSS, and for those people tables are still a good solution.
But what about the problems caused by layout tables, you may wonder?

What problems? Every browser and assistive technology currently in use has had to deal with layout tables for years, and will continue to do so for the foreseeable future.

A layout table is actually very easy to detect and handle appropriately. In the same way that a <div> or <span> tag with no semantically meaningful attributes can safely be ignored by systems looking to extract meaning from markup, a table with only bare <td> tags communicates no semantically significant information, and can be reasonably assumed to be a layout table.
Layout tables may even have some benefits if we open our minds to them. One cell in your layout grid may reasonably be considered a "header" for another cell. Layout tables let you describe this relationship in your markup, while div-heavy CSS layouts do not.

One day, browsers will support the CSS 3 Advanced Layout module, and grid layouts will be easy for anyone to produce with CSS. When that day comes, layout tables may well be out of business, and we'll be happy to see them go.
In the meantime, tables still have a place in web layout.


-------------------
"At tonight's meeting of the Melbourne Web Standards Group, Andrew Krespanis and I (Kevin Yank) have been assigned to argue for the statement Tables Still Have a Place in Web Page Layout. [Above] is a sneak peek at what we plan to say! Please bear in mind: we may not actually agree with everything that is stated here!"
Source: Kevin Yank, Tech Times #170 - The Great Web Debate




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625