Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I've noticed that on most of the third party themes the themers who made the theme have forgotten to include the "Edit" buttons in most of the configuring pages. For example on the user side theres the "My Account" page, and on the administration side... well, every dang page that has several "sides" to it. One in perticular is the "Menu" configuration. The only theme that works is the default XTemplate.
I'm trying to add a visitor counter to my web site powered by drupal. I thought to modify xtemplates and add the code for the counter. I use bbclone and the code to add is
define("_BBC_PAGE_NAME", $title);
define("_BBCLONE_DIR", "~/bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);
but I don't understand where to put this code (some where in xtemplates.theme). It should be on every page and $title should be the title or an identifier of the page.
I've finally hacked my way to a solution for multiple templates. I have been modestly successful in assigning different templates based on the path. I will explore this solution further and if it seems worthy then I will try to develop a patch for the community to use. In the mean time here is an explanation of what I did along with some basic code examples.
Requirements:
Drupal 4.4x
Enable the path module
Basic knowledge of PHP and some Drupal functions
Description:
I wanted to have the ability to display different layouts and possibly style sheets for pages within my site. To accomplish this I modified the path.module to include some additional data. I then modified the logic in xtemplate to look for the the new information.
First, I created an additional column in the db table "url_alias (this is the table that stores path information). I called the new column "template" and I assigned it the same properties as "dst" and "src" (dst, src are columns in the url_alias table).
Then I copied xtemplate and renamed it to mxtemplate. I also changed every reference to xtemplate to mxtemplate so that the system wouldn't freak out (m, for multiple xtemplates).
Next I modified that path.module to include to include a pulldown menu (form_select) of the various themes available within the mxtemplate directory. I also modified several several functions within path.module (there are too many to talk about, but I will try to post the code below).
Now that I had templates assigned to every path alias, I hacked the mxtemplate.theme file.
Basically I wrote a function that compares the current pages path to the path alias stored in the db. If there is a match then it returns the assigned template directory. (see code below)
Code:
Here is a link to the code for the modified path.module. I haven't done a lot of testing of this, so PLEASE if you intend to use this BACK-UP your file.
Are there any examples available where people have added these files to their phptemplate theme? I'd really like to do block.tpl.php at the moment, but I'm a little uncertain of everything that I need in it. Thanks.
I've modified chameleon theme and want to be able to insert an image based on the path alias of the page that is displayed. What is the name of the variable which holds the path alias?
For example:
I have created a page with the path alias of overview. I have also created an image called overview.jpg stored in drupal/themes/chameleon/nav_images
I have a template made out already in HTML/PHP format http://www.atcork.com/beta/preview/check.php .
What I want to know is would it be possible to code a template around this design or am I wasting my time with Drupal as a backend. Are there any better Content management systems for the job?