Remove highlight class from messages.search_snippet
Hello all, We have a custom homepage component built that is showing a few latest threads from our Announcement board. Simple stuff. The problem is that the 'search_snippet' is highlighting the text if it's the same as the search query. In our case, the Announcement board is called 'news' and if it finds a word 'news' inside the 'search_snippet', it will be highlighted with the 'lia-search-match-lithium' class. For now, I'm considering removing it manually with the $('.lia-search-match-lithium').removeClass(); As far as I saw, the 'search_snippet' will always return highlighted text. Is there any way around this? Thank you!Solved2.4KViews0likes2CommentsLab / Idea / Unconference Meetup?
I have a couple things on my community backlog that probably require some level of customization - I tend to be looking for stuff in Atlas that already has some traction or headway AND I see lots of "under consideration" ideas AND I see lots of "Did anybody make an XYZ widget in their community..." questions BUT what I haven't yet found (beyond this forum itself) is an available time and place for Devs to get together on their own and either attack a specific common problem OR talk together through a top of mind issue. It could be anything from a KhorosLed affair or even just an Unconference we put on ourselves. Would be REALLY great if there was a vanilla lab stood up to do actual live-action work that participants could then try to leverage in their own environments later. Am I just not finding this yet? Do we need to bootstrap something? BlakeH - has this come up before?1.5KViews10likes26CommentsBuilt a service/status tracker status based on tags
Hello, I am creating a component that only shows based on the tags given to the message. The tags are hidden for non admins by the way. Using Freemarker I have no luck yet in getting/reading the tags or taglist from the current thread. Please help, half answers are also very welcome 🙂 Does anyone have a code snippet that shows how to 'get' the tags of the thread?Solved1.3KViews0likes3CommentsAPI call to post message has blank response
Hi folks. Been using this in an endpoint for many years, but now it returns a blank response, so I can't read if it was successful. <#assign result_post = restadmin("/boards/id/${board_id}/messages/post?message.subject=${msg_subject?url}&message.body=${msg_body?url}")/> If, however, I do a simple $.post('/restapi/vc/boards/id/${board_id}/messages/post?message.subject=subject&message.body=body') then I get a perfectly normal response. Did something change with the v1 API?834Views0likes6CommentsSet the visitor UI language automatically
Background: Our instance supports 8 different languages for the user interface. Our CDN/Reverse Proxy detects a user's location and can set a user's language based on that. It will, at a minimum, set a cookie. In the past, in the page.init, we would detect if the cookie language was different than the session language and and return a redirect while adding the "?profile.language=xx" parameter. Unfortunately, this caused significant delays for users in China because of the extra round trip. Currently our CDN/reverse proxy rewrites all URLs as they pass through, adding the profile.language parameter to *every* page load. This causes some odd side-effects, especially in the admin panel. It's also very challenging to debug when something is off. Does anyone know the recommended approach to making sure that a user (including anonymous users) gets the Khoros page UI in their translated language? Our CDN/reverse proxy does place a cookie that we can read or it could deliver a special header. I imagine we could read this in page.init, but I don't see anywhere in the docs where we can tell the session to switch languages. This all gives hints: This seems to give some suggestion: https://developer.khoros.com/khoroscommunitydevdocs/reference/requestlang Which leans to info about page.init. Which I think leads me to the http.session: https://developer.khoros.com/khoroscommunitydevdocs/reference/httpsession-1 But, what's the attribute that needs setting? Is it "lang"? If anyone has a list of session attributes, that could be helpful. Other related threads I have read: https://community.khoros.com/t5/Khoros-Community-Product/How-can-users-be-directed-to-a-localized-community-based-on/m-p/564967 https://community.khoros.com/t5/Khoros-Community-Product/Launching-a-new-language-language-functionality/m-p/610975 Thanks! Mark800Views2likes12CommentsWhere do I store a large amount of data, for reference?
Hi folks, planning a custom component which will basically check the user's id against a pre-existing list. I imagine this list could grow into the thousands. What are my options for storing this data/list? One option I use for smaller datasets is a hidden post and simply store it as a comma separated string. Another option might be to store a string in a custom metadata field, I guess? Any ideas how large that could be? (I don't have access to a separate server.)800Views2likes5CommentsLatest activity not displaying
Hi everyone, Our community has a custom component that displays the trending topics, latest topics, and top liked topics on various tabs. I duplicated the component and scoped it to only display the blog posts for a new category. However, only the trending tab is displaying any content. The latest and top liked tab only shows the spinning loading icon. Here is a snippet of the code for the latest tab. I'm unsure of what more needs to change to get the content to display. <#-- recent --> <section class="custom-tab-content messages_recent" id="custom-community-activity-recent" aria-labelledby="custom-community-activity-recent-label" type="recent" target=".recent-message-list" offset="${messages_to_show}" style="display: none;"> <div class="recent-message-list tabbed-message-list"> <#-- Lazy load the results if the user clicks on the tab. --> </div> <#if messages_all_count gt messages_to_show> <#-- lia view all --> <div class="lia-view-all"> <a href="#" class="load-more-button lia-link-navigation">${text.format("custom-general.load-more")}</a> </div> <#--/lia view all --> </#if> </section> <#--/recent --> Any pointers would be appreciated. Thank you!785Views0likes1CommentTrying to use occasion_data.status
I have a simple liql query where I'm pulling in all upcoming and ongoing (in progress) events. According to this doc there should be an object for occasion_data.status in the results. It's working within my query "WHERE occasion_data.status IN ('upcoming','ongoing')" but I get a null value if I try to use it in my FreeMarker template (e.g., <#assign eventStatus = listItems.occasion_data.status/>) Anyone know why? Did they miss adding this? Am I reading the doc wrong? Is my code incorrect somewhere?769Views0likes13CommentsDefault bio widget doen't work for plain Users and can't parse it from DB for plain Users
Hi folks. Need the help of the community brain. Found out that the default user bio widget, which parse User description from the settings doesn't work for plain Users except of Admins. So I decided to write my own component to parse that info from DB. Here is the code: <#include "theme-lib.common-variables.ftl" /> <#if user.registered > <#assign qry = "SELECT biography FROM users WHERE id = '${user.id}'"?url /> <#assign res = rest('2.0', '/search?q=${qry}') /> </#if> <@liaAddScript> ;(function() { const messageElement = document.querySelector('.lia-component-article'); if (!messageElement) return; <#if user.registered> <#if ( res.status?matches('success') && (res.data.size > 0) )> <#assign output = res.data.items[0].biography?esc /> const selectors = { main: '.lia-quilt-row-main', wrapper: '.lia-quilt-column-alley-single', ref: '#labelsForMessage', bio: 'custom-widget-user-bios' }; const parent = messageElement.querySelector(selectors.main + ' ' + selectors.wrapper); const refEl = messageElement.querySelector(selectors.ref); let p = document.createElement('p'); p.classList.add(selectors.bio); p.textContent = '${output}'; console.log(messageElement, refEl) parent.insertBefore(p, refEl); </#if> </#if> }()); </@liaAddScript> It Does work with Admins, but again, does not work with plain Users somewhy. It throw an exception in the console: <div style="font-style: italic; font-weight: lighter; color: darkGrey; background-color: Beige; padding: 10px;" class="lia-widget-not-found"> This widget could not be displayed. </div> Help me pls, what's going wrong with that user bio widget and Data i wanna parse it to the view by myself. Also I didn't find any flag in the admin that could representatively control that feature and enable/disable it.709Views1like3Comments