Stupid PHP (or Drupal?) Question

Status
Not open for further replies.
Hi All,

Sorry for the absolut n00biness of this question. It's such a basic question that I don't even know what to Google for (and get meaningful results back).

Here's my situation. I'm a developer (C#) with no PHP / java / web experience (just my own putzing around). I've set up a website using Drupal 6.x with a purchased template. The website has a button in the middle of it that says, "Read More" (i.e. you click on it to get more info about the company).

My question is: where the hell is the equivalent of the click event? All I want to do is have it go to a new page when the button is clicked. In the .css, I can see where the button image is set, sized, and all that stuff. I don't see anything in the page.tpl.php file that has anything to do with the button. And I don't see anywhere in the Drupal front-end admin that lets me get at that button.

Here's a screenshot of what I'm talking about: http://members.shaw.ca/agullickson/ss3.jpg

Thanks in advance! Any suggestions or pointers would be greatly appreciated.
 
I don't see it in either location (assuming I'm looking in the right place).

Here's the relevant part of what I see in the .css:
Code:
.more { display:block; width:107px; height:43px; background:url(/html//civis/threads/images/readmore.gif) no-repeat 0 0; float:left;}
.more:hover { background:url(/html//civis/threads/images/readmore-act.gif) no-repeat 0 0}
But I don't see anything for the 'more' button in the page.tpl.php file (I can find the search box, the slogan box, etc., but no 'more' box). Looking at the blocks template (I'm assuming that's block.tpl.php?), I don't see anything useful in there either (this is the entire file):
Code:
<?php
// $Id: block.tpl.php,v 1.2 2007/08/07 08:39:36 goba Exp $
?>
<div class="<?php print "block block-$block->module" ?>" id="<?php print "block-$block->module-$block->delta"; ?>">
    <div class="title">
        <h3><?php print $block->subject ?></h3>
    </div>
    <div class="content"><?php print $block->content ?></div>
</div>
Is there another place to look for the block templates?
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
That button is probably just an <a> link; I'm not sure why a click event is "easier to understand" than emitted HTML but I'll take your word for it.

I'm not sure where the code is; I'd have to see the template in order to track it down. My guess is that it's being defined in a block (which you would check from the Blocks page in your Drupal site), but I really can't tell you without more information.
 

Acert93

Ars Scholae Palatinae
1,317
A link to the coded page would help. It looks like it should be norhing more than a simple <a href=> to me. The question is whether the "more" section is hard coded into the Drupal Template (page.tpl), if it is part of a block (administer from the blocks menu in site building), or if it is part of a node (page, story, book, etc; in which case just edit the node).
 
I'd link up the page, but I have it on a temporary test server behind my firewall that isn't accesible from the internet. But thanks for the "<a href" reference. That gave me something to search for, and maybe I found something useful.

In the page.tpl.php file, I found this:
Code:
<?php print theme_image(path_to_theme().'/images/slogan.gif', '', '', array('class'=>'slogan-img')) ?><br />
    <a href="#" class="more"></a>
</div>

I'm not sure if it's relevant or not, but in the node.tpl.php file, I found this:
Code:
<?php if ($page == 0): ?>
    <?php print $picture ?>
    <h1 class="title"><a href="<?php print $node_url ?>"><?php print $title ?></a></h1>
    <div class="submit"><span class="submitted"><?php print $submitted ?></span></div>
<?php endif; ?>

I'm pretty sure (99.9%) that it's not a block, as I don't see anything in the block administration that is it.

While I can't link to the site I have set up, I can link to the sample demo of the template I purchased. It is here: http://osc.template-help.com/drupal_27236/#. Interestingly enough, it seems the button doesn't do anything in the demo. With the Joomla version of the template (here: http://osc4.template-help.com/joomla_29321/#), clicking the 'Read More' button actually does return you to the main page.

One other piece of info that may be beneficial: when I hover over the 'Read More' button, in the lower left corner of the browser (where it shows me where it will take me when I click on it), it says basically where I already am. For example, if I'm on the Contact page and I hover over the 'Read More' button, it says, "http://192.168.32.211/?q=contact#". If I'm on the content types admin page, it says, "http://192.168.32.211/?q=admin/content/types#".

Hopefully this will provide some useful clues.
 

ahankinson

Wise, Aged Ars Veteran
117
You should get the devel & theme_devel modules. They make it really easy to figure out where this sort of stuff is coming from. Install and activate them, and then an overlay box should appear in the lower-left that allows you to turn on the theme developer. Then you can just click on any element that you see, and it will tell you where it's generated.

There may be a file in your directory called "template.php." A lot of templates use this to store custom hooks for theming. Check to see if there's a "cruplex_theme_image()" function in there, or something else with "_theme_image()". That may be emitting the custom code.

If you PM me, I can give you my e-mail address and you can send over the files (I know they're commercial, so the devs probably wouldn't be happy about posting them in public!).
 

Kazram

Smack-Fu Master, in training
90
In the page.tpl.php file, I found this:
Code:
Code:
<?php print theme_image(path_to_theme().'/images/slogan.gif', '', '', array('class'=>'slogan-img')) ?><br />
    <a href="#" class="more"></a>
</div>

That a href should be what you're looking for, change the # to whatever page you want to go to when the button is clicked.

That php outputs the following html:

Code:
<img src="/drupal_27236/themes/theme366/images/slogan.gif" alt="" title="" width="295" height="136" class="slogan-img" /><br />
                        <a href="#" class="more"></a>
</div>
 
Status
Not open for further replies.