This simple widget will render any html string you enter in the layouts custom html theme setting. No restrictions and no styling, just a simple custom html container.
Content inside custom HTML widget disappears upon loading topic after clicking it from topic list. Visible on topic list, not visible after loading topic.
I want to use more than one instance of this widget on the sidebar. Here’s an example with a Quick-start menu on top and a twitter-feed on bottom, alongside other widgets:
To enable that I set up a branch that allows changing the widget name. In the above example I changed the second instance to “twitter-feed”:
And then it can be selected by it’s own name in the layouts settings:
This sounds like a great feature to have, especially for the HTML widget. That being said, I think it would be beneficial to have this across the board for all widgets of the layouts plugin. Perhaps, this is something we could integrate as a core feature for the layouts plugin?
Yup I agree. It would need to be a widget setting rather than a site setting. @nolo would you be interested in making a PR to the layouts plugin along those lines?
*edit Ah I see you made a PR to the layouts widget. This will need to be a PR to the layouts plugin and will need to be a widget-specific setting, not a site setting. Feel up to doing that?
Approach it by selecting a widget setting that’s similar to the setting you’re trying to add. Do a search for that setting name in the code and make idenical additions, apart from a change in the name. Reasoning by analogy will get you pretty far in this kind of situation.
Then make a PR with that change and @keegan can tell you if you need to make any tweaks.
So that’s how I understand how re-naming would work:
There’s a theme setting widget name. So I can change the name of the widget right on the component settings. Then I can select the widget by it’s new name on the dropdown at /admin/layouts/widgets. I shared that flow on the screenshots above.
But to have that option show on the component settings, I need to add it to settings.yml of the component, no? If I’d add the option to the plugin, it would show with the other options on /admin/layouts/widgets. But in fact the additional widget won’t show up with it’s new name on the dropdown select, until it already has a new name. So this actually can’t work?
Hello @angus@keegan , I was using the previous version of this plugin [ https://github.com/angusmcleod/layouts-custom-html ]. This plugin was giving me an option to update the custom html per category. Could you let us know if this is possible with the current version ?