Make Tag Banner also appear on tagged topic pages

Hello Everyone

I want to know if it’s possible to have form in each tag where at the top of the topic I have the needed details of a client let’s say as tag.

This form could be added in more than one topic and shows the clients details let’s say

without having to create a category since we create categories on another criteria

or any other solutions which will help me to automatically show a client details in more than one topic and category?

I don’t think there’s an existing functionality for this. You’d likely have to use a plugin.

However, I could be mistaken. Could you elaborate further on this? Thanks.

which plugin could help me build this workflow?

Hi there, could you elaborate further on your original question? I might be misunderstanding it.

I think you might have to do something custom, but it’s hard to say for sure without more details.

Is what you’re looking for a form in the tooic post, and adds tags to the topic based on the form’s content? Because then you might be able to get away with a Theme Component instead.

If I’m reading your question correctly, it sounds like you use a tag for each client, and you want an extended client description to show up when viewing any topic having that tag.

It’s not a form really, but the Tag Banners component, as seen here on Meta, might get you halfway there:

With this component installed, you can add a text description for each tag that will appear in a banner shown when the tag itself is selected. The text field takes HTML and can be styled with custom CSS so you could do quite a bit with it, but here’s a very plain example where I’m editing a tag:

The challenge would be to alter this component so that it shows up not only on the tag page, but on each topic using that tag. I don’t know how much work that might be, but a more experienced coder (like Nate…) might have some idea.

2 Likes

Thanks @toddz that helped a lot that’s what I need

well "@NateDhaliwal the tag banner will help me a lot but now my question is:

How to make it appear in the topic itself where when I add the tag the details appear on the top of the topic

:+1: Ok, since I understood your question I’ll edit the title of this topic so maybe some more people will take a look.

I imagine it would require forking the component to create a new version, figuring out what triggers the banner to appear on the tag page, and changing that so it’s also triggered when tagged topics are viewed.

You could get lucky and someone will think that sounds like fun – otherwise you might need to figure out a project budget and post a request in the Marketplace.

2 Likes

I’m seeing if this is possible, experimenting with this on a fork. No promises, though!

@Eman_Ahmed I have added this in this fork:

It takes the 1st topic tag and displays it. Controlled by the setting show on topics. If there are no tags, the banner is hidden.

Very cool of you to take this on, Nate. I don’t have the need for it myself, but I was excited to try it out. It works great!

I do see a gotcha, though, when there are multiple tags on a topic. (And it’s hard to imagine managing things with only one tag per topic.)

Tags are either sorted alphabetically or by popularity…

image

…so the author has no direct control over which tag shows first.

I thought using a non-alpha character to start the client tags (~ClientName) might always pop it to the head of the list. This works on the /tags page – but not on a topic, where the tag list just ignores the ~ character. :face_with_diagonal_mouth:

In a topic from last year, it appears that certain non-alpha characters could be inserted invisibly to force sorting: Invisible way to force display order of tags? but it seems this doesn’t work now. When I create a tag today with an apostrophe or comma it’s either rejected or silently stripped out. (Not sure why ~ is accepted.)

The tag sort setting shown above affects both the /tags page and the tag list on topics – but I guess they must use a different alpha algorithm?

Hmm… I suppose it really depends what OP wishes to do. If there’s 1 tag → 1 topic → 1 user, then this would work. Otherwise, there’ll have to be more info :person_shrugging:.