-
-
Notifications
You must be signed in to change notification settings - Fork 14
Update featured story carousel #188
Changes from all commits
03dd8d6
abcb2f2
221bbe4
c542d34
4b9d735
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,14 @@ container: "container-fluid" | |
header_wrapper_class: "featured-jumbotron-home" | ||
--- | ||
{{< home/powered-by >}} | ||
{{< home/highlights >}} | ||
|
||
{{< home/highlights | ||
id="featured-story-container" | ||
publishTarget="ecd_tools" | ||
templateId="featured-story-custom" | ||
count="5" | ||
templatePath="/js/templates/featured-story-custom.mustache" >}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would try to stay consistent with your naming conversation. You are calling this home/highlights but the template is featured-story-custom. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree we need to be consistent. I'll rename the template based on what the shortcode will be named. |
||
|
||
{{< home/projects highlight="ecd.openvsx:ecd.theia:ecd.jkube">}} | ||
{{< home/whats-new >}} | ||
{{< home/stats >}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,13 +18,27 @@ import './src/eclipseApi' | |
import 'jquery-parallax.js/parallax.min.js' | ||
import './src/parallax' | ||
|
||
const solsticeSliderHome = () => { | ||
var owl = $('.solstice-slider-home'); | ||
chrisguindon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
owl.owlCarousel({ | ||
items:1, | ||
autoplay:true, | ||
autoplayTimeout:6000, | ||
autoplayHoverPause:true, | ||
autoplaySpeed: 2000, | ||
loop:true, | ||
}); | ||
} | ||
|
||
var owl = $('.solstice-slider-home'); | ||
owl.owlCarousel({ | ||
items:1, | ||
autoplay:true, | ||
autoplayTimeout:6000, | ||
autoplayHoverPause:true, | ||
autoplaySpeed: 2000, | ||
loop:true, | ||
$(window).on("load", function() { | ||
solsticeSliderHome(); | ||
}); | ||
|
||
|
||
|
||
$("body").on("shown.ef.featured_story", function(e) { | ||
var owl = $('.solstice-slider-home'); | ||
owl.trigger('destroy.owl.carousel'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you trigger a destroy and refresh event. I feel like we are doing something wrong here. I don't really understand. Adding comments in your code would help us understand if this is really needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok i'll add some comments in there. The destroy and refresh here helps because owl carousel needs to be updated after the items have been added to the container div with ajax. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about you try to load the data before initializing owl? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would make more sense, I'll try that. |
||
solsticeSliderHome(); | ||
owl.trigger('refresh.owl.carousel'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{{#featuredStory}} | ||
<div class="container"> | ||
<div class="item"> | ||
<div class="row"> | ||
{{ #image }} | ||
<div class="col-sm-12 match-height-item-by-row vertical-align-container"> | ||
<div> | ||
<img alt="{{ title }}" class="featured-section-webinar-series-1-img" src="{{ image }}"> | ||
</div> | ||
</div> | ||
{{ /image }} | ||
<div class="col-sm-12{{^image}} col-sm-offset-6 text-center{{/image}} match-height-item-by-row vertical-align-container"> | ||
<div> | ||
<h2 class="webinar-series-1-title">{{ title }}</h2> | ||
<p>{{ body }}</p> | ||
</div> | ||
</div> | ||
</div> | ||
<ul class="list-inline text-center margin-top-20"> | ||
{{#links}} | ||
<li><a class="btn btn-white" href="{{ url }}">{{ title }}</a></li> | ||
{{/links}} | ||
</ul> | ||
</div> | ||
</div> | ||
{{/featuredStory}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a component that we would want to re-use on other sites?
If so, we should contribute to the base theme as I did with the search page: https://gitlab.eclipse.org/eclipsefdn/it/webdev/hugo-solstice-theme/-/merge_requests/246
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll try to make that as generic as possible.
This is a featured story block that is pulling multiple items. I could create a shortcode called "featured-story-multiple" on hugo theme. I don't think we should modify the existing featured-story shortcode since the html is not the same in the 2 cases.
What do you think?