Wowchemy-hugo-modules: enable reuse of project widget

Created on 25 Jan 2017  路  12Comments  路  Source: wowchemy/wowchemy-hugo-modules

I love this theme, thanks for the fantastic work and careful design @gcushen.

I'm looking for a way to reuse the projects widget on the home page.

Instead of the custom widget, I'd like to use a copy of the project widget for the classes I taught.

I understand I could use the custom widget, but I'd just love to reuse the design and filtering of the project widget.

The project widget, alas, is already in use, for real (non-teaching) projects.

I suppose once the home view no longer defaults to filtering all, as per #88, then I could probably just hack this by adding "subsetting" to the respective tags ("project", "teaching") in the two incarnations of the project widget.

Perhaps it might be more consistent to have a separate teaching/ (or (foo/) folder though, to which a additional incarnations of the project widget could refer to.

Hope I am making sense.

enhancement help wanted

Most helpful comment

Thanks @gcushen for your precision. I am still a bit confused, so let me know if I'm understanding it correctly: as it is now, the updated Project widget allows its use multiple times in the home page (content/home/projects.md and say a copy as content/home/my-widget-instance-name.md as you suggested). In other words, I can have several sections for projects (let's call them meta-projects), each of them possibly with a list of projects and a filter bar.

However:

  • Filtering on "All" (*) lists all projects, regardless of the meta-project they belong to.
  • Projects can belong to several meta-project (that is, they could be filtered to appear in several meta-projects).
  • All projects have to be in the content/project folder, with no possibility to have them in a separate folder.

Is this the intended behavior (and use!) of the updated widget?

(note that I'm still after the idea of having a people widget, which would be listed in the content/people folder)

Thanks again for your work, and for your help!

All 12 comments

actually, just solving #88 would probably not allow me to re-use the project widget if I am not mistaken.
It appears that when the filter js is used, that filtering on one instance of the project widget, will also filter the other instance.
I am guessing this is a limit of the javascript.

Yes, this feature request is actually a bit more complicated because the Javascript used for filtering would need to be dynamically generated for each instance of the widget. Currently all the JS is in one file, so moving the filtering part of the JS to within the HTML of the widget itself could perhaps make it easier to implement the dynamic JS generation.

Today I was looking for same feature, unfortunately this doesn't seem like an easy task.

Hi, I was about to post this exact same question. The project widget could be used to make a neat list of collaborators or people working in my lab (it would show their picture and a v short bio, and give more info when clicked). I guess I don't even need the filter functionality, so maybe that makes this fix easier? Thanks for making this theme, it's great!

adding my voice to the request list for this feature!

I, too, was hoping to use the Projects widget more than once (similar to scenario described by OP). In #51 @gcushen referenced possibility of Projects using tag filtering similar to Posts -- independent of filter buttons. Would this also run into the dynamic js issue raised above?

+1, really want this feature.

multiple use of Projects widget and each one with different tags instead of showing all the projects by default. For example, I have projects for Math and Computer. when it comes to Math part, Projects for Computer should not appear by default.

Thank you.

I was also looking to do this, and separate my projects in 2 sections. I tried to copy the projects widget and setting it with a different name, but the menu of the widget does not work properly.

This is great news, thanks @gcushen! Looking at the commit (and the changes that come with it), it is unclear to me how to reuse the project widget. Do we have to create a new widget, and change all mentions of project to something else (and then adjust the CSS)? Could you please provide advice to get started? Thanks in advance!

@basille Assuming that you have updated Academic to latest version, you should be able to just duplicate your content/home/projects.md to something like content/home/my-widget-instance-name.md. You can then edit the file to configure the title and filters etc. as you want. You may wish to test it out in the latest exampleSite folder first.

Let me know if you have any other questions. I'll work on trying to update and improve the docs, especially for widget documentation :)

Thanks @gcushen for your precision. I am still a bit confused, so let me know if I'm understanding it correctly: as it is now, the updated Project widget allows its use multiple times in the home page (content/home/projects.md and say a copy as content/home/my-widget-instance-name.md as you suggested). In other words, I can have several sections for projects (let's call them meta-projects), each of them possibly with a list of projects and a filter bar.

However:

  • Filtering on "All" (*) lists all projects, regardless of the meta-project they belong to.
  • Projects can belong to several meta-project (that is, they could be filtered to appear in several meta-projects).
  • All projects have to be in the content/project folder, with no possibility to have them in a separate folder.

Is this the intended behavior (and use!) of the updated widget?

(note that I'm still after the idea of having a people widget, which would be listed in the content/people folder)

Thanks again for your work, and for your help!

I'm looking to use something like this as services I offer, any answers to @basille question?
Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

somnathrakshit picture somnathrakshit  路  3Comments

anirbanbasu picture anirbanbasu  路  3Comments

brianguay picture brianguay  路  4Comments

eduardohenriquearnold picture eduardohenriquearnold  路  4Comments

halfrost picture halfrost  路  3Comments