Fieldtype

Archived
Forum
(read-only)

Jeremy Worboys does not actively monitor this forum
(but you can still get help from other EE users).

JW Nivo

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Jeremy Worboys

     

You must be logged in to post.

No formatting with only one slide

Bug (Resolved)

Bleikur
Bleikur

Hi Jeremy,

if there is only one slide it seems as if the formatting does not work (size, margin, padding etc.).
You can see the difference in the attached screenshots. If there are multiple slides everything looks just fine but if there is only one it just displays as is without any formatting (as it seems).

Template code

<div id="news_details_slide_wrapper">
 
{exp:channel:entries channel="news_details" url_title={segment_2}}
  {news_photos}
 {
/exp:channel:entries}
</div

CSS

#news_details_slide_wrapper {
 
displayblock;
 
clearboth;
 
width500px;

Is this a bug or is there something I can do to solve this?

Best regards,
Bleikur

Jeremy Worboys
# 1
Developer
Jeremy Worboys

Hey Bleikur,

The Nivo Slider jQuery plugin plays up if there is only one image in a slider so I have a detection for this in the output template.

I’m not certain if this will fix the issue on your page, but in system/expressionengine/third_party/jw_nivo/views/template.php try changing line 14:

// OLD
<div id="nivoslider-<?=$entry_id?>"<?php if (count($slides) > 1): ?> class="nivoSlider" <?php endif ?><?=$sizing?>>

// NEW
<div id="nivoslider-<?=$entry_id?>class="nivoSlider" <?=$sizing?>

Let me know if this helps at all. If not, I’ll have to look into it a bit more.

Bleikur
# 2
Bleikur

Dear Jeremy,

if I do the replacement you suggested no image appears at all.

Thanks for the help,
Bleikur

Jeremy Worboys
# 3
Developer
Jeremy Worboys

That is peculiar.

Are you able to provide the details (or a screenshot) of the settings portion of the field type as well as any styles affecting the slider (and its inner elements) as computed by a web inspector (Chrome dev tools, Firebug, etc)?

Alternatively, if this is on a test/staging server that I can access, could you provide the URL where I could inspect this myself? If you’d rather not make the URL public, you can email it to me on jw@jeremyworboys.com.

Bleikur
# 4
Bleikur

Dear Jeremy,

I just sent you the URL via email.

Thank you,
Bleikur

AlanG
# 5
AlanG

Was there any progress on this I’m having the exact issue.

Jeremy Worboys
# 6
Developer
Jeremy Worboys

Yes, we altered the output template.

Try replacing the system/expressionengine/third_party/jw_nivo/views/template.php with the version attached.

File Attachments
template.php  (File Size: 4KB - Downloads: 45)