Closed (fixed)
Project:
Dynamic display block
Version:
6.x-1.0-rc6
Component:
Documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2009 at 03:46 UTC
Updated:
15 Oct 2009 at 09:00 UTC
The code calls a function that doesn't exist: basepath(). It should be base_path() which isn't working very well either. It is returning a link http://node/932
if (isset($result->nid)) {
$slider_items[$key1]['slide_read_more'] = l('Read more...', basepath() . 'node/' . $result->nid);
$slider_items[$key1]['slide_node'] = basepath() . 'node/' . $result->nid;
}
Comments
Comment #1
ppblaauw commentedThanks for reporting.
Strange that base_path() does not work.
Will upload new version soon after some more testing.
Comment #2
ppblaauw commentedNew version uploaded without the base_path() in the l() function.
It is not needed here. The l() function will take care of the path.
Comment #3
Adam S commentedWell, there was another problem. In the link for some reason 'node/' is being 'tokenized'. I'm getting the URL plus the node's title. Not sure why. So instead of http://example.com/node/384, I getting http://example.com/title-of-node???
I solved it by editing the CCK form. I removed the name of the body so I don't have a body anymore. Then I made another text field with a machine name 'rotator_link' which I labeled 'Read more link.' I wasn't sure if I was supposed to add a field to the view so I did anyway. This way with just a drag and drop I can link to any content on my site. Much nicer.
Here is the code in the template.php file:
I also changed the css to make the frame longer and shorter. With the funky Image Crop widget http://drupal.org/project/imagefield_crop anybody who adds an image has to, mandatory, crop it the correct width, height ratio. Very cool stuff.
When I get paid for this project I'll send you a Sunday donation. Thanks for the development!
Comment #4
ppblaauw commentedis the alias for
which is good
The solution and code you use now is similar to: How to link Read more... button to another page instead of the node
Have a look at it. It also adds a little bit more flexible option to use the link you have in textfield and if not available it uses the link to the node.
I used the imagecache_actions module for automatic actions on images but not the imagefield_crop module. Will have a look at it.
Thanks again