Question

HTML block widget

  • 11 February 2020
  • 8 replies
  • 284 views

Working on embedding the html block widget to the community. We tested it out on the almostinsided and it appeared fine on the homepage. How do I get it to appear on a certain page within the community,  

 

 


8 replies

Userlevel 1
Badge

Normally, people first hide the widget / class via CSS for all pages, and then remove this rule when a certain url is detected.

 

Yep I’ve been trying to get Chat GBT’s recommended CSS approach to work for an hour or two but have failed:
 

[href*="example.com"] .some_class {

display: block

}

 

@bjoern_schulze any recommended people to approach to ask this?

Userlevel 2
Badge +3

I am pretty sure that you would need to add a bit of script to the Third-Party Scripts page.

Normally, people first hide the widget / class via CSS for all pages, and then remove this rule when a certain url is detected.

I cannot go into detail more than that, as this is beyond my technical horizion. But should you require more help, then I am sure someone else can chime in and share additional insights.

Userlevel 1
Badge

Thanks @Julian,

 

is the best way to limit the HTML block on the general sidebar to only the topic creation page, is that done via the Insided data object? Is this javascript and where would be best to place the script?

Userlevel 2
Badge +3

Congrats on completing the course! :) 

So you can add an HTML block to the side bar - in this case you would just have to limit it to the topic creation page. 

To add an HTML block to the side bar, you need to go to [Customization] - [Sidebar] and then add the widget to the [General sidebar].

On that note, maybe good to mention that we have a roadmap candidate for later this year to improve the topic creation page, as we agree that such improvements will help to get better content (and reduce Moderation effort).

Userlevel 1
Badge

Does anyone know if there’s still not an easy way to get an HTML block show up on different pages? @bjoern_schulze @Julian et al

 

Use case: we want an HTML block on our ‘create a topic’ page to help support members on what to include in their post, and what not to. 

 

If it’s still the Insided data object, where’s the best resource for this? I’ve just finished a front end engineer course so I’m full of hubris on my capabilities.. 🤣

Hi @bjoern_schulze, @Julian 

CC: @Pav Dhillon 

Thanks for your response.

The aim is to support particular pages on our e-commerce site, using the ‘html’ block widget’ on community articles. 

We saw a really nice example on the a1 Community: https://www.a1community.net/apple-320/das-neue-iphone-11-ist-da-252948. Where they have custom widgets that promote particular props (iPhone in this case) on an article.

I appricate that this isn’t the purpose of the community! But would be good for us to try out and display the power of our community to the wider business. 

Thanks,

Nikhil

 

Userlevel 2
Badge +3

Hey @Pav Dhillon,

Bjoern already pointed out that you can show different content on different pages based on the “inSided data object”, which is true.

But maybe you could share with us on which specific pages you would like to display what? Because this way we get a better idea of what you want to do exactly. This way we have a better idea once my colleagues start working on improvements in this area.

Badge

To only show this HTML widget on certain pages, you’d have to use Javascript and the inSided Data object, which isn’t an easy thing to do, sadly.

There is an open idea regarding custom sidebars for categories that seems to be exactly pointing out the problem you’re facing right now. 

Reply