Working semanticly correct with phpwcms

If you've problems with unsupported - non official ;-) - functionalities use this forum please.
Post Reply
Minime
Posts: 19
Joined: Fri 11. Mar 2005, 18:07

Working semanticly correct with phpwcms

Post by Minime »

Hey there people,

At the moment I'm trying to build a site using phpcms. This site should be semanticly as correct as possible. I've changed the navigational part using this: http://ionrock.umemusic.com/index.php?id=5,8,0,0,1,0 which was recommended on this site.

I've got it working, but with one little problem at the end of my list (after the last </li> but before the closing </ul>) you'll get this:

Code: Select all

<ul>
</ul>
Probably since phpwcms looks at is as if it could have sub-strcuture, can this porblem be solved?

I've got some more issues concerning the symantics, I hope it's not wrong to put these in this post as well, if it's wrong just say so..

Anyway to get to my problems:

although it isn't a big problem, but I wonderd wether you can get rid of the sapce between <body and > if you've kept your body tag empty.

second I'd like to get a wrapper around my whole page (<body><div id="wrapper"> {page} </div></body>)

Third i'd like to get an id in my html tag (I know it isn't correct, but it is really handy once you're using different background images on different pages if you use css) like this <html id="home"> or else in my body tag.

Last but not least I wonder wether it's possible to get uris like this

http://website.ext/page/

instead of:

http://website.ext/index.php?page

I really hope someone can help me with this. I've been looking for it, but couldn't find the answer
Last edited by Minime on Fri 18. Mar 2005, 10:49, edited 1 time in total.
Minime
Posts: 19
Joined: Fri 11. Mar 2005, 18:07

Post by Minime »

I did some digging in the code and now fixxed tha point wehere i mentioned the problem about this:

Code: Select all

<body >
this occurs when you leave you're body attributes empty

I fixed it the following way:
in the file: \include\inc_front\front.func.inc.php
in my version it's rule 380 but with ohers it might be different, for easy of finding: it's in the function: get_body_attributes($values)

There you see at the bottom of the first if:

Code: Select all

return " ".$body;
I changed this into:

Code: Select all

if($body == ""){
  return $body;
}else{
  return " ".$body;
}
Now if you don't have any attributes in your bodytag you'll get <body> instead of <body >. If you do use any attributes it wil still have the little space between <body and the first attribute.

Not a big issue, just one that irritated me.

Anyone else that can help me on the other points?

edit I've been looking quite some time where the body tag is printed but can't find it, anyone knows where that is?
Minime
Posts: 19
Joined: Fri 11. Mar 2005, 18:07

Post by Minime »

The div has also been entered, pretty stupid of me to forget the index.php file. I've changed it and it now uses an <div id="wrapper">.

But still the other things are pretty hard to figure out how the fix them...
Minime
Posts: 19
Joined: Fri 11. Mar 2005, 18:07

Post by Minime »

Ok, I've got the id="$page" as well, it's pretty simple once you've found what way is used to get it from the database, anyways I inserted this in my <html> - tag in my index.php page:

Code: Select all

id=\"".$content["struct"][ $content["cat_id"] ]["acat_name"]."\"
This way you'll get the name of the structure part as the id of your html tag, which ables you to create a different design for each different page using css.

you now get things like:

<html id="Home"> or <html id="info"> you can change the whole layout using this in css:

#Home body {
css
}

etc.

Although it's not yet (yes you read YET, since it'll probably get there..) official, though it can come in really handy and the W3C will probably have it included in their specifications anyway
elv
Posts: 6
Joined: Mon 16. Aug 2004, 19:26

Post by elv »

I second the idea of adding classes or ids to the html or body tag.
It's useful to build a navigation based on css. You can differenciate pages by their type, without the necessity to deal with multiple templates.
I often use body class="topic" or "home" to render some elements differently.
I'll even go further : every article should have an optional "class" field. A simple use would be to change the background, with css based on this class. Building a new template just for this purpose would be overkill!

In the admin, instead of the deprecated attributes (colors, margin, etc. They should be defined in the css no in the html), I'd like to have two fields : "class" and "id".
Post Reply