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.

CommentFileSizeAuthor
#2 template.php_.txt9.33 KBmdayton
template.php.txt9.34 KBmdayton

Comments

ppblaauw’s picture

Status: Active » Closed (duplicate)

Thank 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.

mdayton’s picture

Status: Closed (duplicate) » Active
StatusFileSize
new9.33 KB

Thank 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;
}

ppblaauw’s picture

Title: Links from images or Read More... do not open on mouse click » Linking to other pages instead of node doesn't work
Component: Code » Documentation
Category: support » bug
Status: Active » Postponed (maintainer needs more info)

I 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 functions

It provides variables for the

ddblock-cycle-block-content.tpl.php template file

In 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.

ddblock-cycle-block-content-upright50.tpl.php

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.

  <?php if (isset($slider_item['slide_read_more'])) : ?>
    <div class="slide-read-more slide-read-more-<?php print $slide_direction ?> clear-block border">
     <p><?php print $slider_item['slide_read_more'] ?></p>
    </div><!-- slide-read-more-->
  <?php endif ?>  

Rather a long and technical reply, hope it helps you further, please let me know.

mdayton’s picture

Thank 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:

// add slide_read_more variable and slide_node variable
if (isset($result->node_data_field_pager_item_text_field_url_value)) {
  $slider_items[$key1]['slide_read_more'] =  l('Read more...', $result->node_data_field_pager_item_text_field_url_value);
}

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.

'ddBlock_Slideshow_Frontpage'
stdClass::__set_state(array(
   'nid' => '265',
   'node_title' => 'Cloud Sandbox',
   'node_data_field_slideshow_image_field_slideshow_image_fid' => '263',
   'node_data_field_slideshow_image_field_slideshow_image_list' => '1',
   'node_data_field_slideshow_image_field_slideshow_image_data' => 'a:3:{s:11:"description";s:0:"";s:3:"alt";s:0:"";s:5:"title";s:0:"";}',
   'node_type' => 'ddblock_slideshow',
   'node_vid' => '713',
   'node_data_field_slideshow_image_field_slide_text_value' => 'Instantly provision virtual sandbox environments pre-configured with popular vendor software for evaluation, testing and development.',
   'node_data_field_slideshow_image_field_url_value' => 'http://dev01epmcloud.hynotetest.com/provision',
))

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.

ppblaauw’s picture

As you can see in the debug lines, the fieldname for the url field should be:

node_data_field_slideshow_image_field_url_value

instead of

node_data_field_pager_item_text_field_url_value

so your code becomes:

// add slide_read_more variable and slide_node variable
if (isset($result->node_data_field_slideshow_image_field_url_value)) {
  $slider_items[$key1]['slide_read_more'] =  l('Read more...', $result->node_data_field_slideshow_image_field_url_value);
}

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

mdayton’s picture

That 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!

ppblaauw’s picture

Status: Postponed (maintainer needs more info) » Fixed
Issue tags: +Advanced slideshow, +preprocess functions

Set status to fixed, add tags Advanced slideshow and preprocess functions.

Status: Fixed » Closed (fixed)
Issue tags: -Advanced slideshow, -preprocess functions

Automatically closed -- issue fixed for 2 weeks with no activity.