First of all, thanks for the great module. I am not a coder at all and it took me some time to get through install and config, but I have configured two advanced slideshows and an image block with links using your instructions. Problem I am having is that the URL's i have defined in image slideshow in block and read more... links do not open when I click on them.
URL appears correctly in my FF browser status bar on rollover, but when I click the slide/image simply advances to the next and the link is not opened.
In the attached template file, I have duplicated preprocess functions to handle two advanced slideshow ddblocks (showcase1 and Slideshow_Frontpage).
Probably a simple coding error on my part somewhere, but would appreciate some direction.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | template.php_.txt | 9.33 KB | mdayton |
| template.php.txt | 9.34 KB | mdayton |
Comments
Comment #1
ppblaauw commentedThank you for your interest. All your code is Ok. Good job!
See issue: Read more ... link is there, but doesnt work
If you search the issue queue on: read more for any issue, you can find the answer and don't have to wait till I or someone else replies. Also have a look at the FAQ at http://ddblock.myalbums.biz. for frequently asked question and answers and at the howto's for more tips.
Comment #2
mdayton commentedThank you for your help. I went through the Answer and found that the problem was fixed for the simple image only ddblock i had running, but that it did not fix the issue for the "read more..." button on my advanced slideshow. It appears that the URL field is not being recognized by pre process function. Instead, the "Read more.." link continues to point to the node of the view created for the slideshow itself.
I tried removing pager option to see if it made difference, but it did not.
I have attached my revised template.php file in case it helps.
Also, I am wondering if there is an error in your instructions below. I tried code both ways (with and without the [$result->], so that is probably not what is causing my problem. Forgive me if my point is ignorant, but I am a marketing guy who only plays coder on TV :-)
// add slide_read_more variable and slide_node variable
if (isset($result->nid)) {
$slider_items[$key1]['slide_read_more'] = l('Read more...', 'node/' . $result->nid);
$slider_items[$key1]['slide_node'] = 'node/' . $result->nid;
}
Change to:
// add slide_read_more variable and slide_node variable
if (isset(node_data_field_pager_item_text_field_url_value)) { *****did you intend to omit the [$result->] on this line?******
$slider_items[$key1]['slide_read_more'] = l('Read more...', $result->node_data_field_pager_item_text_field_url_value);
$slider_items[$key1]['slide_node'] = 'node/' . $result->nid;
}
Comment #3
ppblaauw commentedI changed the issue title, component and the category.
It's difficult to keep posts manageable and useful for other users when more then one issue is posted in one issue, please try to post one topic per issue. Ok that said, thank you for finding the bug. We always try to improve the documentation.
I added the $result-> in the documentation on ddblock.myalbums.biz.
First I try to explain a little bit more what the preprocess functions, templates are for.
The preprocess functions are used to provide variables to template files.
In the case of the
preprocess_ddblock_cycle_block_content functionsIt provides variables for the
ddblock-cycle-block-content.tpl.php template fileIn the ddblock-cycle-block-content.tpl.php template file you can now use these variables.
By providing candidate template files in the: template_preprocess_ddblock_cycle_block_content preprocess function in the ddblock module, the template files of ddblock themes are used instead.
e.g.
Your Issue:
The "ddBlock_Slideshow_Frontpage" part of the code looks ok if you provide a field: url in your cck and view.
You can find out which fieldnames cck/views provides by uncommenting the drupal_set_message lines at the top of the preprocess function.
In the "ddBlock_showcase1" part of the code I see you don't give variable to the template file for the title and the readmore button (so they will not show up, but still the classes are made in the template files)
You could add if statements to the ddblock-cycle-block-content-[ddblock-theme-name]tpl.php file to prevent the classes to show, like the following.
Rather a long and technical reply, hope it helps you further, please let me know.
Comment #4
mdayton commentedThank you for clarifying posting etiquette. I am sure I am making rookie mistakes as I get through this issue and appreciate your patience. I added code to template 50 tpl file per your instructions and uncommented the Showcase1 preprocess code. The Read More button is not even displaying and I think it has something to do with the code I have entered:
When I added this code the Showcase1 code, the Read More button disappeared as well, so I reverted back to standard code for Showcase1 since it is simply a test slideshow to provide functionality down the road.
Here is the drupal message returned when I uncommented the preprocess lines per your instructions. It appears to me that the url field is working properly in node and view, but for some reason is not making it to the slideshow.
I am displaying this slideshow within a node using the PHP code provided on your site. Could the fact that I am displaying within a node creating an issue?
Again, thank you for your assistance.
Comment #5
ppblaauw commentedAs you can see in the debug lines, the fieldname for the url field should be:
instead of
so your code becomes:
No, displaying in a node has no influence on this.
Hope this helps you further and explains how you can get the fieldnames , with the debug lines, to use in the preprocess functions. Please let me know
Comment #6
mdayton commentedThat worked! I had inserted the field value "node_data_field_pager_item_text_field_url_value" earlier before I posted. I didn't work at the time, but I believe it was because I was missing a "{".
I really appreciate the patience and respect shown for a non-coder in helping me resolve this issue. Now the the module is functioning properly, I may be in touch shortly regarding some paid services to help adjust theme. Is your site the best way to reach you for commercial services?
Thanks again!
Comment #7
ppblaauw commentedSet status to fixed, add tags Advanced slideshow and preprocess functions.