Revised code

<div id="list-option-<%inf_pageid%>">
    <%txt_body%>
</div>
<script>
    // convert all UL in this section to SELECT
    $('#list-option-<%inf_pageid%> ul').each(function(){
        var OptionHTML = '<select>';
        
        // convert all LI to OPTION
        $(this).find('li a').each(function(){
            OptionHTML += '<option value="' + $(this).attr('href') + '">' + 
$(this).text() + '</option>';
        });
        
        OptionHTML += '</select>';
        
        // insert option html after the UL
        $(this).after(OptionHTML);
        
        // hide original UL
        $(this).hide();
    });
</script>

On Wednesday, August 21, 2013 10:28:40 AM UTC-4, Jian Huang wrote:
>
> Hi Joel,
>
> When CMS is the doing the internal link ([ioID]blah blah/blah blah), it is 
> looking for those internal links inside a href.  The easiest way make those 
> links inside ul li a inside the text editor and then use JS to convert ul 
> li a to select option.
>
> Sample code:
>
> <div id="list-option-<%inf_pageid%>">
>     <%txt_body%>
> </div>
> <script>
>     // convert all UL in this section to SELECT
>     $('#list-option-<%inf_pageid%> ul').each(function(){
>         var OptionHTML = '<select>';
>         
>         // convert all LI to OPTION
>         $(this).find('li a').each(function(){
>             OptionHTML = '<option value="' + $(this).attr('href') + '">' + 
> $(this).text() + '</option>';
>         });
>         
>         OptionHTML += '</select>';
>         
>         // insert option html after the UL
>         $(this).after(OptionHTML);
>         
>         // hide original UL
>         $(this).hide();
>     });
> </script>
>
> On Monday, August 19, 2013 5:16:30 PM UTC-4, Joel Kinzel wrote:
>>
>> Jian,
>>
>> The linking appears to be working fine. Here is what I did to test it:
>>
>> Create a new text area. Hand code select box with one option pointing to 
>> a freshly uploaded PDF. After coding, but before viewing, check the "Show 
>> Usage". It properly shows usage. Go back, edit the text area, removed the 
>> link. Show usage also reflect accurately. 
>>
>> The problem is that when in SmartEdit selecting an option from the drop 
>> down, and clicking "Go!" brings us to this: 
>> [ourcmsinstall.com]/cms/WebClient/[ioID]CBAE680ED571454F8276230CB716414B 
>>    
>>
>> Obviously the href of an anchor is treated differently, I'm wondering if 
>> there might be a way to "trick" the CMS into rendering the proper URL by 
>> putting fake anchors or something like that on the page via JS.
>>
>>
>> On Monday, August 19, 2013 7:57:09 AM UTC-5, Jian Huang wrote:
>>>
>>> Hi Joel,
>>>
>>> Well, I do have an untested reason to avoid the code by hand method.  If 
>>> I manually coded the link to Folder A/A.pdf.  When I go to Folder A, select 
>>> A.pdf, click view usage, would the location I manually coded be recognized 
>>> as one of the area in the project that uses it?
>>>
>>> Since you already have a project, would you mind testing:
>>>
>>> 1.  Manually code link to a file that had no usage before
>>> 2.  Go to folder, file, check usage, does it recognize the linking?
>>> 3.  Preview page now, so CMS runs the manual linking code.
>>> 4.  Go to folder, file, check usage, does it recognize the linking now?
>>> 5.  Manually remove link to a file
>>> 6.  Go to folder, file, check usage, does it recognize the removed 
>>> linking?
>>> 7.  Preview page now,
>>> 8.  Go to folder, file, check usage, does it recognize the removed 
>>> linking now?
>>>
>>> Thanks,
>>>
>>> -Jian
>>>
>>> On Friday, August 16, 2013 4:23:35 PM UTC-4, Joel Kinzel wrote:
>>>>
>>>> Would there be a reason to avoid the coded by hand (as in my example 
>>>> above) option? We are basically just getting the selected value and then 
>>>> doing a window.location with it.
>>>>
>>>>
>>>> On Tuesday, August 13, 2013 5:59:15 PM UTC-5, Jian Huang wrote:
>>>>>
>>>>> Hi Joel,
>>>>>
>>>>> Use a container instead of a list
>>>>>
>>>>> <select>
>>>>> <%con_options%>
>>>>> </select>
>>>>>
>>>>> Then you can have option content class  and page instances of those 
>>>>> connected to con_options.
>>>>>
>>>>> Then in your option content class, you can have med_document, which 
>>>>> can only point to 1 document folder...hmmm...how many document folders 
>>>>> are 
>>>>> we talking about here?
>>>>>
>>>>> You can either have N option content classes each with different 
>>>>> med_document or 1 option content class with N med_document_folder_name
>>>>>
>>>>> Sent from my iPhone
>>>>>
>>>>> On Aug 13, 2013, at 4:09 PM, Joel Kinzel <[email protected]> wrote:
>>>>>
>>>>> All, 
>>>>>
>>>>> Here is my situation: 
>>>>>
>>>>> I have a customer that needs a select box that can have any number of 
>>>>> items in it. Those items can link to internal pages, external pages, or 
>>>>> assets. 
>>>>>
>>>>> My first thought was list with following pages, which works alright, 
>>>>> but the assets exist in multiple database based asset folders. Moving 
>>>>> those 
>>>>> database based folders to file system based folders would mean that we 
>>>>> would lose any linking to the assets in those folders. The site is a 
>>>>> decent 
>>>>> size and has many, many documents that are all correctly linked at this 
>>>>> point. 
>>>>>
>>>>> So my second thought was (as ugly as it is) have the tech. for the 
>>>>> side hand-code the drop downs, inserting the ugly GUIDs for pages, and 
>>>>> the 
>>>>> path to the cached files. So right now this is what we have: 
>>>>>
>>>>>  <select>
>>>>>>     <option>Select A Form</option>
>>>>>>     <option value="[ioID]1BC27CB5C81646988BCB6955544FD6DD">Animal
>>>>>> Tissue Pickup Request</option>
>>>>>>     <option value="[ioID]A6D2C1F8DA9748D995057DD7E351F154">Biosafety
>>>>>> Protocol</option>
>>>>>>     <option
>>>>>> value="[ioID]3E110B6564F144F589A4DB4878057A87/OBSSelfAssessmentForm.xls">Bios
>>>>>> afety Self-Assessment</option>
>>>>>>     <option
>>>>>> value="[ioID]04994206236C4CE59EDFED36BF3A5F3F/ApplicationRadiationDosimeter.p
>>>>>> df">Campus Dosimeter Application</option>
>>>>>>     <option
>>>>>> value="[ioID]29FE37F7DB3A4C1B95C58C942E39B68F/ChemicalInventoryForm.xls">Chem
>>>>>> ical Inventory Form</option>
>>>>>>
>>>>>>  </select> 
>>>>>
>>>>>  <button type="button" class="surfto">Go!</button>
>>>>>
>>>>>  
>>>>>
>>>>> And this works for the first 2 values, but after that the CMS doesn't 
>>>>> seem to know what to do. Here is where it is trying to go:
>>>>>
>>>>> For a file:
>>>>> [ourcmsinstall.com
>>>>> ]/cms/WebClient/[ioID]3E110B6564F144F589A4DB4878057A87/OBSSelfAssessmentForm.xls
>>>>>
>>>>> And a page: 
>>>>> [ourcmsinstall.com
>>>>> ]/cms/WebClient/[ioID]CBAE680ED571454F8276230CB716414B
>>>>>
>>>>>
>>>>>
>>>>> Anyone have any ideas as to why some of the items would work and 
>>>>> others would not? Any solutions you've used for a similar situation?
>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "RedDot CMS Users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>> To post to this group, send email to [email protected].
>>>>> Visit this group at http://groups.google.com/group/reddot-cms-users.
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>  
>>>>>  
>>>>>
>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"RedDot CMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/reddot-cms-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to