What Are The Units Used For last_publish_time
ThisGet messages posted or edited in a specified range of time (khoros.com)says n days, but the example heremessages (khoros.com)is using numbers like1577836860000. I thought maybe it was milliseconds but that doesn't seem to be the case. When I use 31540000000 which I believe is 365 days in milliseconds I am getting results from a board that did not exist a year ago. Anyone know what the units are or am I using this wrong? Thanks. SELECT subject FROM messages WHERE board.id = "aktestboard" AND last_publish_time > 31540000000 LIMIT 1000Solved110Views0likes2CommentsFinding out the subscribers to a categories/Boards/Topics
Hi , I am looking for the Apis for getting the details,count of a subscribers who have subscribed to a category,boards,topics. we have an API for getting the number of subscribers to a board. boards/id/administration/${coreNode.id}/email/board Similar way is there any API for gettting the List of subscribers to a category and topics as well.AnchaAjay3 years agoGuide168Views0likes2Commentstext key with condition
I'm trying to use this key with a custom component li.memberships.MembershipCount.count= {count, plural, one{1 member} other{# members}} How I can pass the mentioned parameters in text.format("li.memberships.MembershipCount.count") to get the results with theplural condition. answer with an example code as great helpmuraleedharan3 years agoHelper116Views0likes3Commentsscheduled task or cron jobs within Lithium
Curious if anyone has had the need to run automated scripts within Lithium, and how you went about doing it. Typically, creating a cron job on a server would suffice, but im unaware of any feature within Lithium that would allow such a function. Our other option would be to use a "middleware" standalone server to run the scheduled task, but this would require the overhead of managing a separate server. Is there a more efficient and streamlined solutionfor scheduled tasks? thanks, TriSolved155Views0likes3CommentsMake extraction of questions asked by customers easy
Hi everyone, We are working on a bot and would like to have the possibility of carrying our targeted computer extraction on the questions asked by our app users. We do only have the possibility to go for un CSV document which is not that relevant for us. Would that be possible to developp a kind of special loading question tag? Y faithfully, AnneInactive User3 years ago67Views0likes1CommentCustom Component Tiled navigation
I currently have a custom component that tiles the categories in a core node that the component sits in. Problem is I want the boards in a certain category to be shown that isn't the core node the component sits in. So if I put the below code in any page it will show the hierarchy of that page. I want to put this tiled navigation on the home page but have it show the boards in one of my categories. I've tried a few changes but it doesn't show properly. <#assign baseQry = "SELECT id, short_title, description, view_href, topics.count(*), avatar.medium_href FROM nodes" /> <#if coreNode.nodeType?lower_case == "community"> <#assign whereClause = " WHERE depth=1 " /> <#else> <#assign whereClause = " WHERE parent.id = 'category:${coreNode.id}' " /> </#if> <#assign orderClause = " ORDER BY position ASC" /> <#assign fullQry = baseQry + whereClause + orderClause /> <#assign nodes = commonUtils.executeLiQLQuery(fullQry) />Solved150Views0likes1CommentProduct mentions count
Hey everyone, did any one try to use API v2 to count a specific Product mentions over the whole community? I'm having issues to get the number without counting how many times the sequence iteration was. Should it be a simpler way to do that? Like saying images count()? Let's say SELECT id, subject, view_href FROM messages WHERE products.id = '8468538' now I need the total of #s is mentioned...76Views0likes1CommentCan we add hreflang code/tags to our Communities?
Hi, I'm trying to find out if we can implement hreflang code to identify country-specific content or categories on our communities? We're interested in doing this to make sure that Google correctly ranks content from our communities for each country that our community is built for. For example, we want to make sure Google only ranks US content for US users, and only UK content for UK users - and so on. Is this possible with Khoros? Thanks in advance for your help!Ellen_G3 years agoExpert469Views1like4CommentsNew Post with Pre-filled form values
Is there any way to create a custom link or button that passes values to the new post page input fields? So, let's say someone is in a TKB for X Product. And they can't find an answer, so they click a button on the page that says "Ask a question about X Product". And it takes them to the New Message form (postpage quilt, I believe) and since they were just in the X Product TKB, we want a tag or label to get automatically added to that input field in the new message form, so it would already have X Product as a label or tag when they type up their question. Is there any way to do this or are there potential security implications that are preventing this? Our CMs spend a ton of time cleaning up/adding labels/tags and I think something like this would really clean up our Q&A spaces.Natkinson3 years agoGenius423Views0likes1CommentLabel ID change?
We have been using the Khoros Community API v2 to bring Ideas data into an internal application. Recently we noticed that the information pertaining to labels has changed. Previously here is an example of what the API returned: { "type": "label", "id": "541", "text": "Utility Network" } And mid September this changed to this: { "type": "label", "id": "Utility Network", "text": "Utility Network" } Was there an API change in a release that is documented somewhere or can provide more information. I checked release notes on 21.7, 21.8 and 21.9 and don't see any mention of changes to label in the API.Solved256Views0likes6Commentshow to Retrieve subscribed labels thru API ?
Hi I want to get label's text a user subscribed to. So I use : api/2.0/search?q=SELECT * FROM subscriptions where target.type = 'label' and subscriber.id='<my user id>' ==> this gives me a list of label id But I can not use these ids like api/2.0/search?q=SELECT * FROM labels where id = '13' because I get "Invalid query syntax". I read that "Queries to thelabelscollection must be constrained bymessages.id." But where I can get this message.id ? Is there a better way to get the text of my labels ? ThanksSolved170Views0likes1CommentLogging a user out not working
Hello, I'm currently developing a solution to log out a user from the community sessions automatically. I followed the API Reference here:https://developer.khoros.com/khoroscommunitydevdocs/reference/authsignout I am currently getting the correct response of the user being signed out of all sessions but when I go to the community forums with my test user I can still see the user logged in. This is the json response that I am receiving: { "status":"success", "message":"", "data": { "signed_off_all_sessions":true, "id":"#######" } } Context: we do use a cookie for our users to log into the community site if they are logged into our site. But I have made sure to just be logged into the community site without said cookie when trying this call out. Any help would be welcomed.622Views0likes12CommentsFuture Ingestion of "Twitter Communities?"
Hi all, Wondering if there's been any discussion around Twitter's new "Communities" feature they're looking to explore/launch? Curious about how this might impact the Khoros ecosystem. This feature is only in testing, so API connections are likely not available yet for exploration on the Khoros side, but posting my initial questions here, and hoping others who have similar/other questions might add them on in the comments/replies! Marketing: How will we create & publish content to a Community through KM? Will there be a separate/new (or updated) API to allow brands to schedule posts to a TW Community? How do we track KPIs for tweets to a Community? Will we be able to easily differentiate between Tweet performance for those sent to a Community versus our normal followers? Care: Can we engage with a Community Tweet via KC? Can we easily join/leave a Community via KC? How will we be able to tell which is a Community tweet versus a normal public tweet (maybe there’s something in the API that could trigger an automatic tag)? If a brand is tagged in a post within a Community, but we’re not part of it, are we able to engage with it? Communities: Will there be options to link a Khoros Community to a Twitter Community?amber_gj3 years agoContributor58Views2likes0CommentsPreloaded Text In Tinymce Editor
I am trying to create a component to add to the PostPage that will prefill the text editor with some questions to answer when posting an idea. I tried using this tinymce.activeEditor.setContent("<p>Test Question One<br><br><br>Test Question Two</p>"); I also tried document.getElementById("tinymce").innerHTML = "<p>Test Question One<br><br><br>Test Question Two</p>"; I tried saving a .js file to "Other Assets" so I could "defer" the execution until after the page loads in case that was the issue. I found this great postDefault template for suggesting an idea in Idea Ex... - Atlas (khoros.com)byPerBonomiand tried to use his code minus the category check. In every case the editor remains blank. Any idea where I might be going wrong? ThanksSolvedAkenefick3 years agoGenius583Views0likes3CommentsCreate custom endpoint to authenticate token/session key
In our community we aren't using the SSO approach, I'm trying to access community pages(Controlled by role permission) from one of our product websites and want some ideas to authenticate the call through a session key/token and create a auto login session with a common community user I created. I couldn't find much in Docs. Is there anyway I can achieve this? Any idea is much appreciated as we are working on a short deadline. Thanks in advance.469Views0likes4CommentsHelp - Message component to use in Forum Topic Pages
Hi, We want to highlight certain posts, float them up so to speak, that are important for users to read, but are technically not the solution to the posted problem. Now we mark them as solution, users don't like it (the mail says the topic is solved), and we have issues counting how much real solutions are given. We want to give the post a tag. All posts with this tag are floated upwards. The logic is complete, only thing I need is a handy message component to incorporate into my own component. Using@messageUtils.renderMessage I can realize a message component - but not with the topic layout. Instead it has the forum board layout. I checked the corresponding macro, it didn't have what I am looking for. In short how do i add a message to a forum topic (assigining a specific message id )? Is there a OOTB component for such a thing? I believe every message in a formum topic is a actually page:Forum Message. This makes things complicated. Below the code of my component so far. <@liaMarkupCache ttl="600" variation="node" anonymousOnly="false" /> <@compress single_line=true> <#-- import libraries and fetch thread id --> <#import "theme-lib.common-functions.ftl" as commonUtils /> <#import "custom.message-macros.ftl" as messageUtils /> <#assign threadId = page.context.thread.topicMessage.uniqueId /> <#-- fetch posts (messages) with tag 'uitgelicht' --> <#assign query = "SELECT id, subject, body, metrics.views, tags, labels, images, post_time, post_time_friendly, conversation.last_post_time, moderation_status, conversation.last_post_time_friendly, author.id,author.login, author.avatar.message, view_href, author.view_href, read_only, author.rank.name, author.rank.color, author.rank.icon_left, author.rank.bold, author.rank.icon_right, author.online_status,board.id, author.avatar.profile, board.view_href, board.title, replies.count(*), kudos.sum(weight), conversation.solved, conversation.style, user_context.read FROM messages WHERE tags.text = 'uitgelicht' AND topic.id = '${threadId}' ORDER BY post_time DESC" /> <#assign highlightedData = commonUtils.executeLiQLQuery(query) /> <#-- Build the thing--> <div class="lia-text lia-forum-topic-page-reply-count lia-discussion-page-sub-section-header lia-component-reply-count-conditional" style="text-transform: none;">Uitgelicht</div> <#if highlightedData?has_content> <#list highlightedData as msg> <@messageUtils.renderMessage msg/> </#list> </#if> </@compress>328Views0likes2CommentsReplacing Anonymous Message Icon
I replaced theicon_anonymous_message.png image in studio under images in our custom skin. This is the icon that shows for a message from a user after their account is closed. My new image shows up on stage like it is supposed to, but after publishing the old image is still showing in production. Any idea why this is happening? ThanksAkenefick3 years agoGenius253Views0likes2CommentsIntercept editor form submission vs auto-save
Hi, I'm trying to enhance our message post editor form with additional dropdown fields, including browser used. This information will be pushed to tags (could also use custom tags or even custom message metadata fields, but we went for the simple way using OOTB functionality). My implementation challenge is intercepting the editor form submission event to populate the tag information and submit the form afterwards. I'm currently using code similar to below: <@liaAddScript> ;(function($) { var setupinfo = $('#dtk_setup_info').detach(); $(setupinfo).insertAfter('.lia-form-attachments-fieldset-toggle'); // Intercept form submission $(".MessageEditorForm#form").submit(function(e){ e.preventDefault(); var form = this; // Populate the "Tags" field with valid data from the dropdowns var tagPrefill = ""; if ($( "#browser_used" ).val() != null) { tagPrefill += ", " + $( "#browser_used" ).val(); } document.getElementById("lia-tags").value = tagPrefill; form.submit(); //delegate form submission event bypassing the jQuery bound event }); })(LITHIUM.jQuery); </@liaAddScript> The issue I am facing is that the editor form's auto-save feature is actually als triggering a form submisson event. As a result any user who keeps the editor open long enough for the auto-save event to occur will have their message submitted unwantedly. I cannot find a way to tell apart a user-initated form submission from the auto-save one. Any ideas?204Views0likes2CommentsBull API return cvs instead of json
Hi, I am using Excel VBA, and I wrote the code below [...] httpObject.Open "GET", sUrl httpObject.setRequestHeader "client-id", KHOROS_CLIENT httpObject.setRequestHeader "Authorization", "Basic " & EncodeBase64(KHOROS_TOKEN & ":") httpObject.setRequestHeader "Accept", "application/json" but I got results in CSV. what is weird, is that in a previous call I usedhttpObject.setRequestHeader "Accept", "text/csv", and since when it seems that there is a cache mechanism that keeps returning CVS, even if I ask JSON is my assumption correct ? Is it a bug or a feature ? Do you know how to 'force' the result to be JSON, and 'forget' the previous CSV results ?334Views0likes2CommentsHow to change the order of the post an idea page
Hello Everyone, Hope to find you well. Do you know how to change the order in the image below, between for example labels and tags? And how to remove the associated products? I thought it would be on studio but I can't seem to find the page. Thank you!adriana4u4 years agoMaven664Views0likes2CommentsCustom Component: Recent post by roles.name not working
Hi Community, Currently we are using a custom component to show the latest posts from a specific group of users. In our platform we have 2 main categories that work as different communities. One is in Spanish and one in Portuguese. So, in order to show the posts for each category, we use a key text to differentiate each one. Saying that, this is what we are using: <#assign rolestop=text.format("custom.query.top_users","") /> <#assign authorQuery="select id from users where roles.name IN (${rolestop})" /> <#assign authors=commonFunctionUtils.executeLiQLQuery(authorQuery) /> <#if authors?size gt 0> <#assign authorListArray=[] /> <#list authors as author> <#assign authorListArray=authorListArray + [author.id] /> </#list> <#assign authorList=authorListArray?join("','") /> <#assign messagesQuery="select id,subject,body, post_time,view_href,author.login, author.id, board.id,board.title,board.view_href,post_time,post_time_friendly,user_context.read,conversation.solved, kudos.sum(weight), board.title, board.id,metrics,replies.count(*) from messages where category.id = '${coreNode.id}' and author.id IN ('${authorList}') order by post_time desc LIMIT 10" /> <#assign parceirosPosts=commonFunctionUtils.executeLiQLQuery(messagesQuery) /> <#if parceirosPosts?size gt 0> <#list parceirosPosts as parceiroPost> <#assign authorPostQuery="select rank, view_href, login, id, avatar from users where id = '${parceiroPost.author.id}'" /> <#assign authorPost=commonFunctionUtils.executeLiQLQuery(authorPostQuery)[0] /> [...] In the key text (for the version in SP) we are using exactly this one custom.query.top_users = 'Artesando de Noxus','Escudero de Demacia','Inventor de Hextech','Trovador de Jonia','Soporte al jugador' Now the problem: The component is only showing the posts from authors with 'Soporte al Jugador' role and ignoring all others. If I remove that role from the key-text, it shows all the others without problem. I really don't have a clue why this is happening. I would really appreciate your help. Thanks in advance! KR,484Views0likes4CommentsAPI Authentication
Hi, I'm new to the Khoros community and looking for some clarification on API authentication. Specifically, is it required for GET requests? I see it is listed as required in the API documentation but in practice, I am not running into any permissions error when testing on community.khoros.com. Example: GEThttps://community.khoros.com/api/2.0/search?q=SELECT * FROM categories Thank you for any insight!Solved652Views0likes3CommentsDefault 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.621Views1like3CommentsSubscription API usage
I am trying to use the API described here:(https://developer.khoros.com/khoroscommunitydevdocs/docs/subscribe-to-community-events). This feature is already enabled on stage and production environments. I created an admin user with the necessary API rights. I tried toauthenticate this user using the sessions key option as described here:https://developer.khoros.com/khoroscommunitydevdocs/docs/session-keyusing postman. I got a 502 Bad Gateway response. Do I need to enable CORS and whitelist IPs as described here:https://developer.khoros.com/khoroscommunitydevdocs/docs/getting-started-with-api-1too?nerisa4 years agoContributor542Views0likes1CommentAPI for label search
Hi Team, I am trying to search all messages in any dashboard through labels; however, don't see any message either through API v1 or v2. Please find the API which I am trying to use https://site/api/2.0/search?q=SELECT subject,id FROM messages WHERE labels.text='GPS_Generic'&restapi.session_key={{tz_session}}&restapi.response_format=json or https://site/restapi/vc/search/messages?q=label.text:GPS_Generic&restapi.session_key={{tz_session}}&restapi.response_format=json Please let me know is something wrong which I am doing. Thanksvivekksi4 years agoContributor484Views0likes0CommentsCommunity plugin SDK in Docker
Hi All, Like others in the Developer forum here, I use the plugin SDK and sometimes struggle to set up the development environment. My main machine is Windows and that's not officially supported for the SDK. For a long time I've used a Linux VM hosted at my company, but as we're working from home that tends to be slower to access now, especially with all of the "source files" on a network folder. I've finally taken the time to create a Docker image that makes setup a breeze. I've used Docker before but this is my first time creating a "recipe" -- it took a lot of trial and error to avoid some of the setup gotchas. The image is here for yourdocker pull if you want to try it: https://hub.docker.com/repository/docker/cjdinger/khoros-sdk I also shared the original Dockerfile on GitHub because...well...it's my first one of these and who knows what I screwed up. If you know better, you might have a shot at fixing it. I use VS Code on my local host machine to maintain the source files. I also use git (we use GitLab) for source control from within Windows (PowerShell). I use this new Docker container only when I need to run thelicommands to build and submit the plugin to our stage environment.cjdinger4 years agoLeader405Views9likes3CommentsHow do I push new post notifications (e.g. via webhook) to third party services?
Good morning team, My goal is to make Khoros a "single source of truth" for several different discussion spaces at my company. Not all of them support RSS... but many of them support REST webhooks. How could I configure Khoros to send REST POSTs (aka webhooks) to specific listener URLs when topics are created? How could I filter that to specific labels, groups or admin tags? Thanks in advance for your help.508Views0likes1CommentHow to duplicate subscribe buttons using Vanilla JS
I thought this might be usefull. This is what I did: Add a script to a component, create an event listener that awaits the full DOM being built, listen for the button id you want to duplicate, replace the button id in your component. By using cloneNode(true) i am duplicating instead of moving DOM nodes. <#if condition> <script> window.addEventListener('DOMContentLoaded', (event) => { function duplicateSubscribeLinkToTopicStatus() { let subscribeLink = document.getElementById('addThreadUserEmailSubscription'); let unsubscribeLink = document.getElementById('removeThreadUserEmailSubscription'); let targetLink = document.getElementById('custombuttonid'); if (subscribeLink) { var newLink = subscribeLink.cloneNode(true); newLink.className = "customclass"; newLink.innerText = "Follow for updates"; } if (unsubscribeLink) { var newLink = unsubscribeLink.cloneNode(true); newLink.className = "customclass"; newLink.innerText = "Unfollow for updates"; } if (targetLink) { targetLink.replaceWith(newLink); } } duplicateSubscribeLinkToTopicStatus() }); </script> </#if>Hoekstra_VFZ4 years agoAdvisor157Views1like0CommentsCommunity Plugin SDK Compatibility
Can anyone confirm which operating systems the Khoros Community Plugin SDK (i.e.lithium-sdk) is compatible with? The documentation only mentions Mac OS X and CentOS, and I just confirmed that Windows isn't compatible. (See attached screenshot) But what I really want to know is whether CentOS truly is the only Linux distribution that is supported or if others are supported as well. I was hoping to install the SDK on a system running Ubuntu Server (latest LTS release) but now I'm not sure if it'll be successful and if I need to spin up a docker container or VM instead. Anyone have any experience around this? Thanks!!Solved512Views0likes9CommentsBuilt 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.3KViews0likes3CommentsIssues using .split() and .get(index) in Velocity email templates
We're add UTM tags to links in our email templates and need to split the post URL into 2 parts so it can be rendered as follows: Example: ${urlPath}?utm_tags#${urlHash} I've been unable to successfully use the Velocity .split() and .get(index) functions. Anyone else tried this or have another solution? Separately, any idea which Velocity version is running on Lithium? ThanksSolvedttadej4 years agoAdvisor312Views2likes5CommentsChecking for user cookie consent
Wanted to share this Freemarker snippet for use in custom components which checks if a user gave consent to the Khoros Community popup for cookies. <#assign cookieConsent = http.request.cookies.name.get("LithiumCookiesAccepted") /> <#if cookieConsent?? && cookieConsent.value?? && (cookieConsent.value == "true")> <#-- Lithium/Khoros Cookies are accepted --> </#if> We are using this in our community to show a close button on announcement banners and only then set a cookie to hide the announcement banners until their content changes.639Views5likes2CommentsFind out specific data for messages using API (LIQL)
Hello, we are trying to figure out a high performant way to fetch all messages in the last x days. LIQL comes in mind as we don't need many fields: SELECT subject, ... FROM messages WHERE depth = 0 The issue we are struggling with is, that we need the following information: - Solved Time: Date when the conversation was marked as solved. - Last answered by: User who created the last answer in the conversation. We can get date by conversation.last_post_time but not the user - First Response Time: Date of the first reply. We could fetch ALL messages, group them by conversation id, order them by post time and calculate these information ourselves - but this sounds like A LOT of wasted data transferred - we would have to fetch almost 5x the data. We already searched through the documentation. Our ideal way of doing this would be to: - Have these fields available at the conversation object - Have the conversation object fetchable - Overall give the conversation object more meaning: E.g.: Give the conversation object the subject of the first message, a board assignment, etc.kaiwerther4 years agoContributor284Views0likes0CommentsAny cons of NOT using LITHIUM.jQuery when calling an endpoint from a component?
Hi folks, I was wondering if usingLITHIUM.jQuery when calling endpoints is the only preferred way of doing it: <@liaAddScript> ;(function ($) { $(document).ready(function () { function callLithiumEndpoint() { $.ajax({ url: '${endpointUrl}', }) } callLithiumEndpoint(); }); })(LITHIUM.jQuery); </@liaAddScript> Can it be done with vanilla JavaScript inside a <script> tag as well, for example using fetch? I noticed that endpoints can be triggered from a browser or a postman via their path https://<community-name>/pjakv59666/plugins/custom/<some-path-to-endpoint>/<component-name> Can it be treated as a simple url, passing there parameters and parsing it?Solved1.6KViews1like2CommentsApostrophe in PM subject - Text Editor
Hi folks, editing some PMs in the Text Editor and having an issue I don't remember the solution for. Trying to use a contraction in the subject line, but instead of you're I getyou''re. Tried escaping with \, encoding it as %27 and using a double apostrophe (saw '' in some other text strings), but no luck. Has anyone done this successfully?190Views0likes6CommentsHow do you get the compose private message lightbox to open?
I am just starting to learn to make custom components with FreeMarker and the API. As a practice project I am making a friends list which should allow you to send a friend from the list a private message. I copied the following URL from the "Send this user a private message" link on the profile page. (friendID and friendName are my own variables) <a href="/t5/notes/privatenotespage/tab/compose/note-to-user-id/${friendID}">Message ${friendName}</a> When you click this on the user profile page it opens a lightbox with the message editor on top of the user profile page. My component instead opens the "privatenotes" page and you have to click the new message pencil icon to open the lightbox editor. It does at that point autofill in the username of the friend you selected. So just curious why it behaves differently? ThanksAkenefick4 years agoGenius422Views0likes2CommentsIssue with registration_data.registration_time in Rest API v2
I want to get registration_data.registration_time from search api. But when I use the following request ../api/2.0/search?q=SELECT registration_data.registration_time FROM users I got anembeddedregistration_data object:in the JSON {... "items":[ {"type":"user", "registration_data":{ "type":"registration_data", "registration_time":"2021-08-10T19:53:22.682+02:00" } } ],... Instead, I want to get just a flat record, like: [{"type":"user","registration_data.registration_time":"2021-08-10T19:53:22.682+02:00"}] How can I do this ?387Views0likes0CommentsUpgrading to Forums 5, now the reply subjects aren't showing
We use a custom article layout. In Forums 4.xx and below, <@component id="message-view.widget.subject" disableSubjectLink="true"/> Worked fine to show the Re: subject line However, in Forums 5 the subject line doesn't snow. Is there a new component or is this a bug? This is the sort of thing that drives me crazy about Khoros community. Things, inlcuding customizations work fine, until one day, without proper documentation, things are updated and then don't work anymore.SolvedInactive User4 years ago859Views0likes9CommentsComponent update
Hello and good day! A couple of days ago I made some changes to one of the components (on the homepage for recent threads). After deploying those changes, I noticed that another component got updated which is the 'usermenu' component. It basically reversed the order from notifications->pm->usermenu to usermenu->pm->notifications. As far as I know, no one made any changes to that specific component. Also, there's nothing on the Versions page that would indicate anyone making changes there. The problem was easily fixed in a couple of minutes, but I would like to know if there are any other ways or options to see what exactly happened there. To better explain myself, I attached two images. Please ignore the missing image as my avatar, that's on Stage. Thank you!djondinium4 years agoExpert460Views0likes0CommentsCreate Custom Component Based On Roles
Hey Dev Discussion, right now in my community we're trying to leverage a component to show permissioned based boards depending on your role in the community. For example, we have 3 Roles: A, B, and C Role A has permission to the component and 2 links. Role B has permission to the component and 3 links are displayed but has Role A also. Role C has permission to the component and 4 links are displayed but have Role A and C. I believe I saw this code elsewhere and was trying to make edits to make this possible without creating separate components. When I did create separate components, for example, Role A could see their component. When signed into Role B could see Role A's links. And Role Bs could see their links in another component and Role A's component was still there. I hope this makes sense thus far! Haha! Here is the script I was going to leverage and attempt however, didn't seem to work when I tried to throw in <#elseifs>. <#attempt> <#assign user_has_role = false /> <#if user.registered > <#list restadmin("/users/id/${user.id?c}/roles").roles.role as role> <#if role.name?? && (role.name == "Employee" || role.name == "Administrator" || role.name == "Ambassador")> <#assign user_has_role = true /> </#if> </#list> </#if> <#if user_has_role > Role A <#elseif> Role B <#/elseif> <#elseif> Role C <#/elseif> <#/if> </#attempt> Open to other suggestions around this! Thank you!403Views0likes1CommentPrivate messaging via REST API
I do apologize if this has already been asked and answered (I looked through support and knowledge base but couldn't find it). I want to implement private messaging functionality via REST API. I have already found how to: Send private message Delete private message Get only unread messages Get all in- and out- box messages Change message status on "Read" But I cannot find methods in REST API for the following: Change message status on "Unread" or "New" Get message status("Read", "Unread" or "New") Sort private messages in the inbox or outbox by Sent or Received date(Descending and Ascending) Sort private messages in the inbox or outbox by Subject(Descending and Ascending) Could you please tell me, are these methods exist in REST API?Solvediahiqosolutions4 years agoAdvisor660Views1like6CommentsEvents (occasion) RSS feed for syndication
We're using the Events module more, but one thing we were missing was a way to syndicate the events to other sites in a useful way: chronological by date of upcoming event, including title, desc, feature image...etc. I created an endpoint component to produce the RSS feed that I think we need for this. I've decided to share it here in case others find it useful. A few values are coded for our community but most are easily replaced for your case. In the comments I included some sample URLs that control which labels are included in the feed, how many items ahead, etc. If you'd like to see an example of this output, here's a sample feed from our community. <?xml version="1.0" encoding="UTF-8"?> <#-- sample URLs: Default event board: https://communities.sas.com/plugins/custom/sasinstitute/sasinstitute/events-rss Specific event board: https://communities.sas.com/plugins/custom/sasinstitute/sasinstitute/events-rss?board=community-events Specific event board, no event message body in feed: https://communities.sas.com/plugins/custom/sasinstitute/sasinstitute/events-rss?board=community-events&description=false Next 10 events: https://communities.sas.com/plugins/custom/sasinstitute/sasinstitute/events-rss?board=community-events&size=10 Next 5 events for "Users Groups": https://communities.sas.com/plugins/custom/sasinstitute/sasinstitute/events-rss?board=community-events&label=Users%20Groups --> <#-- our community domain, checking for stage vs prod --> <#assign root="https://communities.sas.com"/> <#if config.getString("phase", "prod") == "stage"> <#assign root = "https://communities-lithiumstage.sas.com" /> </#if> <#assign board = http.request.parameters.name.get("board","events")/> <#assign label = http.request.parameters.name.get("label", "")/> <#assign filter = http.request.parameters.name.get("filter","upcoming")/> <#assign include_desc = http.request.parameters.name.get("description", "true")/> <#assign size= http.request.parameters.name.get("size","5")/> <#assign time_filter = ""/> <#if filter != ""> <#assign time_filter = "AND occasion_data.status = '${filter}'"/> </#if> <#assign label_filter = ""/> <#if (label)?has_content> <#assign label_filter = "AND labels.text MATCHES('${label}')"/> </#if> <#assign board_href = "#"/> <#assign board_title = "Events"/> <#assign board_description = ""/> <#assign boardq = rest("2.0", "/search?q=" + "select title, description, view_href from boards where id='${board}' and conversation_style='occasion'"?url)/> <#if boardq.data?? && boardq.data.items?? && boardq.data.items?size gt 0> <#assign board_href = "${boardq.data.items[0].view_href}"/> <#assign board_title = "${boardq.data.items[0].title}"/> <#assign board_description = "${boardq.data.items[0].description}"/> <#if board_description==""><#assign board_description = "${board_title}"/></#if> </#if> <#assign events = rest("2.0", "/search?q=" + "select subject, view_href, body, videos, images, occasion_data.start_time, labels from messages where board.id='${board}' ${time_filter} ${label_filter} AND depth=0 order by occasion_data.start_time ASC LIMIT ${size}"?url )/> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" > <channel> <title>${board_title}</title> <link>${root}${board_href}</link> <atom:link href="${http.request.url?replace('&','&')}" rel="self" type="application/rss+xml"/> <description>${board_description}</description> <#if events.data?? && events.data.items??> <#list events.data.items as event > <item> <title>${event.subject} | ${event.occasion_data.start_time?datetime?string("dd-MMM-yyyy")}</title> <link>${root}${event.view_href}</link> <guid>${root}${event.view_href}</guid> <#if include_desc == "true"> <description>${event.body?html}</description> </#if> <#-- add either an image from the message or a video thumb, whichever we have --> <#if event.images?? && event.images.query??> <#assign images = rest("2.0", "/search?q=" + "${event.images.query}"?url )/> <#list images.data.items as image> <#-- need to escape & in the XML, and these URLs can sometimes have them --> <enclosure url="${root}${image.medium_href?replace('&','&')}" length="0" type="image/jpeg"/> <#break> </#list> <#elseif event.videos?? && event.videos.query??> <#assign videos = rest("2.0", "/search?q=" + "${event.videos.query}"?url )/> <#list videos.data.items as video> <enclosure url="${video.thumb_href?replace('&','&')}" length="0" type="application/x-shockwave-flash"/> <dc:type>MovingImage</dc:type> <#break> </#list> </#if> <#if event.labels?? && event.labels.query??> <#assign labels = rest("2.0", "/search?q=" + "${event.labels.query}"?url )/> <#list labels.data.items as label> <#-- category tag: good enough for WordPress, so good enough for us --> <category><![CDATA[${label.text?html}]]></category> </#list> </#if> <#-- this "pubDate" will always be in the future which may confuse some aggregators --> <#-- but I didn't know how else to encode the event date/time in the feed --> <pubDate>${event.occasion_data.start_time?datetime?string["EEE, dd MMM yyyy HH:mm:ss"]} GMT</pubDate> </item> </#list> </#if> </channel> </rss> I've tried the feed in some aggregators like Feedly and in Microsoft Outlook -- it seems to pass muster. Questions and suggestions are welcome!479Views4likes3CommentsMoving a message between threads
Hi all, Has anyone managed to figure out moving a post between threads within the same discussion via the API? I can't find anything about this in the documentation. Ex. I want to move reply 122 from message 17564 in the board testBoard to be a reply to reply 125 in message 17564 in the board testBoard.436Views0likes1CommentIssues with batched queries
Hi, I'm trying to create a batch request fetching the latest posts in a users favorite areas, the number of unread messages and the number of notifications. I have had some partial success so far but I've run into two issues: I can't find any documentation on how to do ordering in a json query. I can't constrain the query for notification_feed to a specific user in api/v2 as I could in api/v1. Is there any other good solutions for getting the notification count for a user [ { "query":{ "messages":{ "fields":["id","subject","teaser","body","view_href","post_time","conversation.featured","conversation.style","conversation.last_post_time","conversation.last_post_time_friendly","author.id","author.href","author.view_href","author.login","author.avatar.message","board.id","board.title","board.parent_category.title","metrics","kudos.sum(weight)"], "constraints":[{"category.id":{"in":["<<category1>>", <<category2>>"]}},{"depth":{"=":0}}], "limit":5 } } }, { "query":{ "inbox_notes":{ "fields":["id","is_read"], "constraints":[{"user.id":{"=":"<<id>>"}},{"unread_only":{"=":true}}] } } }, { "query":{ "notification_feeds":{ "fields":["id"] } } } ]SolvedPeter_Taraldsen4 years agoContributor1.4KViews0likes4Comments