I can understand HTML and CSS but I know nearly nothing about PHP. I started to hack xtemplate to fiddle with the theme but I don't understand how I can access the layout of the preset modules.

For example I think I'm able to create a new block from scratch and then type in directly the PHP or HTML code. So I can mess all I want. But how can I change the display of a preset module like "Who's online" ? How can I change for example the div class it uses? If I look at the produced HTML I see:

|div class="form-item"||label for="name"|Username:|/label||br /||input type="text" maxlength="64" class="form-text" name="edit[name]" id="name" size="15" value="" /||/div|
|div class="form-item"||label for="pass"|Password:|/label||br /||input type="password" class="form-password" maxlength="64" name="edit[pass]" id="pass" size="15" value="" /||/div|

(Also, how can I paste html code on the forum so that it doesn't get paresed?)

How can I access directly those lines to change how the block will appear? Please explain in the simpliest way possible...

Comments

Abalieno’s picture

Noone could help? I really don't know how to use different styles to format the preset blocks ...

From the orginal post I've moved from xtemplate to phptemplate but I still don't know how to access the html code *inside* each block. I just know how to change the general layout. How could I replace the "form-item" class of the previous example with another one with a different name (like "form-item-custom")? I really cannot find where in the code I can access that.

Dries’s picture

Each block has a unique CSS ID so you should be able to style each block independently. If you want to change the generated HTML code, you'll have to modify the module or the theme function responsible for generating the code. Does that help?

Abalieno’s picture

Well, for now yes. I was hoping for more control over the preset blocks content. I wonder if there's a list of variables I can use freely on custom blocks.

Something that gives me a list of the various $date $title etc.. and that explains me exactly their output and how I could tweak it, if I can (for example, it's possible to extract just the day number from $date ?).

For example $links seems to paste directly comments links plus administrate link etc.. And I'm always searching more control on each different part.

Abalieno’s picture

Here's more, $links use by default "|" to separate each link:
print $links

That's the only piece of code I know to deal with it. Let's say that I want to enclose each link using [ ]. Where I can access the code to change it? Where $links is defined to use the "|" sign?

Prometheus6’s picture

Why replace the class name? Why not just define it the way you want it to look in your style sheet?