Layouts Plugin

I made a separate repository and made the changes proposed here.

but it seems that the plugin has caused the rebuild process to crash (when I remove it the rebuild is going ok).

I think it should be more:

  contents.push(
    this.attach('button', {
      action: 'toggleBookmark',
      title: tooltip,
      label: label,
      icon: 'bookmark',
      className: buttonClass
    })
  );

  contents.push(
    new ComponentConnector(this,'topic-notifications-button', {
      topic,
      appendReason: true,
      showFullTitle: false
    })
  );

than

contents.push(
          this.attach('button', {
            action: 'toggleBookmark',
            title: tooltip,
            label: label,
            icon: 'bookmark',
            className: buttonClass
        }),
          new ComponentConnector(this,'topic-notifications-button', {
	     topic: topic,
	     appendReason: true,
	     showFullTitle: false
	})
        )

tried it but still get errors with the rebuild.

It’s working for me with the previous change:

1개의 좋아요

It seems to work for Angus as well, as he shows in his snapshot. but as soon as I add the repository, the rebuild fails :frowning: .

I’ll double check the codes with the proposed changes and test again.

I’m almost certain this is failing because your plugin is named “buttons-widget” and you are using DiscourseLayouts from plugin.rb of your plugin, which will cause a constant loading error.

ATM plugins are loaded in the alphabetical order of the folder name: discourse/lib/plugin/instance.rb at main · discourse/discourse · GitHub

3개의 좋아요

I’ll rename it the same as the one Angus has done (profile-widget!), as it’s the best description for the widget!

Many thanks :+1: The problem was the naming, or as said alphabetic orders.

just a double check: the topic-timeline has disappeared from the topic page. is it a change in the layout plugin or should I look for the reason somewhere else?

we only have the left sidebar activated and there is space for the timeline.

Hi @angus
Thanks for the last update, and please take a look at the following issue :slight_smile:
https://github.com/angusmcleod/discourse-layouts/issues/3

1개의 좋아요

Fixed :slight_smile:

https://github.com/angusmcleod/discourse-layouts/commit/dc24d1cfe04c6e60dab7bc30052801e0ace0ab9a

2개의 좋아요

Is the topic-timeline removed from the topic page in the layout plugin?
@angus

1개의 좋아요

Yes, this broke after the cleanup. Fixed. Thanks.

https://github.com/angusmcleod/discourse-layouts/commit/ec07ba181100843b67c2ff341b10049e4e31bd09

2개의 좋아요

@angus :grin:? Can’t find it.

we’d previously developed something similar. it’s here:

https://github.com/Alavi1412/widget-bookmark

but it’s slight issues (it’s not shown as a selection in the layout admin page), and the developer is not around.

a bookmark filter (which exists in the discourse-app) would do the same job.

1개의 좋아요

@exetico Yes that widget has taken various forms. I’ve cleaned it up and made it available again as layouts-topic-list.

https://github.com/angusmcleod/layouts-topic-list

You can list bookmarks and / or suggested topics (when viewing a topic). Both lists can be toggled with settings.

You can see it in action in the layouts category in my sandbox.

3개의 좋아요

that layouts category link doesn’t work.

My site is rebuilding. I’m testing a sysadmin issue. Give it 30 minutes.

1개의 좋아요

Thanks. Fast response as always!

Have you an overview with all known widgets/layouts (other than the ones, made by you)?

It could also definatly be a good idéa to make a new template for layouts, other people could jump on (Remember comments :wink:) - and also recommend to put something like “discourse-layouts” as topic in their Git’s.

Update:
I think a lot of people will appreciate an example where custom_fields for plugins is included, too (user-editable options) [1] [2].

Update2:
Just a tip - I think you need to update the code behind the Twitter-solution. The widget showing up one more time, after each page-visit (without reload). I had the same issue with $( document ).ready(function() {}); after you improved how the scripts is handled. I’m not using the Twitter-widget feature at the moment.

Update3:
If you prefer to have the a-link in the Bookmarks-title, it would be nice if there was a call to the users bookmarks as well :slight_smile:

1개의 좋아요

Map navigation widget link is broken in original post.

I can no longer edit the original post. The map navigation widget is here if you’re interested:

https://github.com/PavilionDev/pavilion-navigation