Sorry, that was my copy and paste error - I am using AddKeyword.

The keywordGUID variable has 1 GUID so from a SmartEdit source code point 
of view, everything looks fine, e.g.,

<script src="/cms/PlugIns/AddKeyword/AddKeyword.js"></script>

<script>

InitRqlParams("6059BFE756384E06A4D92F6225D278CD","6059BFE756384E06A4D92F6225D278CD");

AddKeyword("BD208A8FB3F54B0CAC54BFFC960EA478","FB10DD3D680D4B95BB1D106E5CAACFB4");

</script>

I guess my attempt at AddKeyword.js is wrong - just wanted a simple 
function to be passed a keyword GUID and assign it to the page, just like 
where you saved the filename to the page.

Neil

On Wednesday, 18 July 2012 19:36:29 UTC+1, Jian Huang wrote:
>
> Hi Neil,
>
> You are calling AssignHeadlineAsFileName instead of AddKeyword.
>
> Also, when you are feeding in keywordGUID from preexecution or rdexecution 
> variant, does it have 1 guid or multiple guids like ####, ####, ####?
>
> If it is the later format, the AddKeyword need .split to parse it.
>
> Please let me know if you are still running into issues.
>
> Best,
>
> -Jian
>
> On Wednesday, July 18, 2012 4:04:48 AM UTC-4, Neil Fegen wrote:
>>
>> Hi Jian
>>
>> Thanks for replying
>>
>> In the template, I have this (similar to your code):
>>
>> <!IoRangeRedDotMode>
>>     <script src="/cms/PlugIns/AddKeyword/AddKeyword.js"></script>
>>     <script>
>>         InitRqlParams("<%inf_loginGUID%>", "<%inf_sessionKey%>");
>>         AssignHeadlineAsFileName("<%pageGUID%>","<%=keywordGUID%>");
>>     </script>
>> <!/IoRangeRedDotMode>
>>
>> Looking in the source code, there are GUIDs for the four variables so 
>> this part seems to be OK - it must be the .AddKeyword.js file (see first 
>> post and attachment) that I have wrong.
>>
>> In any case, I simply want to look at the parent page and if it is 'A', 
>> assign keyword 'X' to this page; otherwise, if it is 'B', assign keyword 
>> 'Y'.
>>
>> Regards
>>
>> Neil
>>
>> On Tuesday, 17 July 2012 18:59:14 UTC+1, Jian Huang wrote:
>>>
>>> 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.html
>>>
>>> Best,
>>>
>>> -Jian
>>>
>>> On Monday, July 16, 2012 4:07:17 AM UTC-4, Neil Fegen wrote:
>>>>
>>>> Hi guys
>>>> Based on Jian Huang's AutoFileName 
>>>> plugin<http://simplyreddot.blogspot.co.uk/2012/02/auto-file-name.html>, 
>>>> 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
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"RedDot CMS Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/reddot-cms-users/-/pCMhqZOoAtMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/reddot-cms-users?hl=en.

Reply via email to