Hi Neil,
Did also include "AutoFileName.js" and have the following javascript run first?
InitRqlParams("<%inf_loginguid%>", "<%inf_sessionkey%>");
my autofilename plugin's code is within SmartEdit only blockmark, so it only runs within SmartEdit, so you might want to check your code to see when it runs.
Your code is fine in the scenario when the target page do not already have keywords assigned. It becomes more difficult when something is already assigned. Please check out code in this plugin for handling category and keyword on pages.
http://simplyreddot.blogspot.com/2012/02/tagit.htmlBest,
-Jian
On Monday, July 16, 2012 4:07:17 AM UTC-4, Neil Fegen wrote:
Hi guys
Based on
Jian Huang's AutoFileName plugin, I've tried to make something similar to add a specified keyword to a page, rather than using cumbersome RQL directly in SmartEdit.
I'm getting nothing saved - can anybody help with why the following might not be working (main function only)?
function AddKeyword(PageGuid, KeywordGuid)
{
var AddKeywordRQL = "";
AddKeywordRQL += "<PROJECT>";
AddKeywordRQL += "<PAGE guid=\"" + PageGuid + "\" action=\"assign\">";
AddKeywordRQL += "<KEYWORDS>";
AddKeywordRQL += "<KEYWORD guid=\"" + KeywordGUID + "\" changed=\"1\" />";
AddKeywordRQL += "</KEYWORDS>";
AddKeywordRQL += "</PAGE>";
AddKeywordRQL += "</PROJECT>";
var strRQLXML = padRQLXML(AddKeywordRQL);
$.post(rqlaction_url, { rqlxml: strRQLXML },
function(data){
// saved
}, "xml");
}
Thanks
Neil