Decided to gather some useful tips that I've used while building my site http://100777.com
Let's call it "Tips'n'Tricks for a newbie by a newbie". Additions are more than
welcome.

 

Ive got my block-paths set up like this:

#/gm([^\d]|$)|/or/62([^\d]|$)#

that displays the particular block in both /gm /gm/ and /taxonomy/page/or/62,
/taxonomy/page/or/62/ but not /gmooho or /taxonomy/page/or/620 Or this one displays
a block (in this case an RSS newsfeed) in on many nodes:

#/or/59([^\d]|$)|node/view/370([^\d]|$)|node/view/365([^\d]|$)|view/or/52([^\d]|$)#

Some blocks, like the one on http://100777.com/tv are in PHP format, and look
like this: "include_once 'boxes/tv.html';" and tv.html is just a html
page with a image on it. How did I get those /gm links then? With mod_rewrite.
In .htaccess created an "alias by putting

RewriteRule ^gm$ ?q=taxonomy/view/or/62
RewriteRule ^gm/$ ?q=taxonomy/view/or/62

The same way I rewrite articles that have now moved after I've updated my site to Drupal, like this:

RewriteRule ^nwo/120\.htm /node/view/252  [R=301,L]
RewriteRule ^nwo/119\.htm /node/view/253  [R=301,L]

Bees-knees!

Didn't figure out a way to do it in just one rule like I did in polder.theme that I configured in a nice way to show different contents (in this case a piece of graphics, the CSS, and the meta tags) for different pages. For example http://100777.com/ark is different to the main page and http://100777.com/plan. The magic behind it:


<?php <br>
global $$_SERVER[REQUEST_URI];
<p>if ((preg_match ("^/or/39$^", $_SERVER[REQUEST_URI])) || (preg_match 
  ("/\bark\b/i", $_SERVER[REQUEST_URI])))<br>
  <br>
  { <br>
  print "<tr><td class=\"LogoArk\" height=\"180\" 
  align=\"right\">\n</td></tr>\n";<br>
  }</p>
<p>elseif (preg_match ("'^/$'", $_SERVER[REQUEST_URI])) { </p>
<p>print "<tr><td class=\"LogoFront\" height=\"67\" 
  align=\"right\">\n<img src=\"";<br>
  print $this->style['path_logo'];<br>
  print "\" alt=\"Logo\" />\n</td></tr>\n";<br>
  } </p>
<p>else { <br>
  print "<tr><td class=\"LogoNode\" height=\"27\" 
  align=\"right\">\n</td></tr>\n";<br>
  }</p>

Basically just "if the user requests a specified page, in this case /or/39
or /ark, /ark/ ($_SERVER[REQUEST_URI) then display a logo, else if he requests
the main page it displays another logo, else display "LogoNode".... Well, that's
todays show, some things that didn't take long at all to plan but ended up taking
me days to create. Easy for a skilled person but caused me to ask for help from
friends (all those Regular Expressions and brackets) -

 

- One thing I've done from time to time since I'm comfortable working in Dreamweaver
is view a page's source, copy the entire source and paste it into Dreamweaver
and analyze it there....

- Good tools to have are PHPMyAdmin and MySQL-Front, a good Windows based text
editor is Ultraedit

Comments

artsee’s picture

Thanks for sharing.

I'm building a community portal and hope to provide website hosting via Drupal.

The delivery of pages that differ in layout will come in handy.

I am not a programmer either and will be looking at these notes very closely in the near future.

ax’s picture

you can write "[^\d]" as "\D". save resources ;)

arsart’s picture

What path expression must be for showing block only on index page?
I tried several times different exp, such as &lt/index&gt &lt/&gt .
i`m just frustrated by this.
Thanks in advance.

gunner’s picture

Has then been updated to work with the CVS? This is perfect if I can get it to work...