Hi Stu,

Thanks so much for your code... The problem is, the server is running cold
fusion... But hey... I'll give a go and see if asp will work...

Cheers mate!

Andry


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Stu Wilson
Sent: Thursday, 17 November 2011 7:59 PM
To: RedDot CMS Users
Subject: Re: RedDot <if> statement and querystring

Andry

You will need to do this in code.  We have implemented a few of these and
they bascially all follows the same pattern.  Note, this code is not Unicode
capable.  Also note I beleive this is leagacy ASP code written in JScript.

Loop thru your navigation:
<%
    // variable to hold the entries we need to display
    var arrLetters = new Array();
    <!IoRangeList>
    // get the letter for the page and add to letters list
    var intLetter = "<%hdl_PageName
%>".substring(0,1).toUpperCase().charCodeAt(0) - 65;
    // create the array if necessary
    if (arrLetters[intLetter] == undefined) arrLetters[intLetter] = new
Array();
    // add the entry to the list
    arrLetters[intLetter].push("<%hdl_PageName%>|<%lst_Navigation%>");
    <!/IoRangeList>
%>

that builds up an array of letters, and each array (per letter) is either
undefined (no items with that letter) or antoher array of items beginning
with that letter

<%
    /************************************************
     * LOOP FOR ALL THE ENTRIES TO SHOW THE BUTTONS *
     ************************************************/
    for (var intLoopLetter = 65; intLoopLetter < 91; intLoopLetter ++)
    {
        // get the letter that we're dealing with
        var strLetter = String.fromCharCode(intLoopLetter);
%>
                <li id="iABC-<%=strLetter%>" class="ABC-<%=strLetter %>"> <%
        // do we have that letter in the list to show
        if (arrLetters[intLoopLetter - 65] == undefined)
        {
%>
                    <span><%=strLetter%></span> <%
        }
        else
        {
%>
                    <a href="#iABC-<%=strLetter%>-List" title=""><
%=strLetter%></a> <%
        }
%>
                </li>
<%
    }
%>

then once you have the list of available Letters, you show the content.
Each letter gets its own div, and items within that div correspond to the
page

<!IoRangeNoRedDotMode>
<%
    /*****************************************
     * LOOP FOR ALL THE ENTRIES TO SHOW THEM *
     *****************************************/
    // get the letter that we're dealing with
    var strLetter = "";
    var strActualLetter = "";
    var strMyLetter = "";
%>
<!/IoRangeNoRedDotMode>



<!IoRangeList>

<%
    // get the letter we're dealing with
    strActualLetter = "<%hdl_PageName%>".toUpperCase().substring(0,1);
    // are we a different letter
    if (strActualLetter != strLetter)
    {
        if (strLetter != "")
        {
%>
            </ul>
        </div>
<%
        }
        // save the letter for later
        strLetter = strActualLetter
%>
        <div class="list" id="iABC-<%=strLetter%>-List">
            <h3><%=strLetter%></h3>
            <ul>
<%
    }
%>

            <li>
                <a href="<%lst_Navigation%>"><%hdl_PageName%></a>
            </li>
<!/IoRangeList>


<!IoRangeNoRedDotMode>
<%
    // always need to show the closing bit %>
        </div>
<!/IoRangeNoRedDotMode>

    </div>
<%
}
%>



Obviosuly I've left some HTML out, but it should get you started.

Also note that if your list is not sorted alphanumerically, then you will
have to sort the entries in each sub-array.

Stu

On Nov 14, 1:24 pm, "Andry Poernomo" <[email protected]> wrote:
> Hi Richard,
>
> Oh right... hmmm... how and I supposed to implement this function...
>
> Andry
>
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Richard Hauer
> Sent: Monday, 14 November 2011 9:19 PM
> To: [email protected]
> Subject: RE: RedDot <if> statement and querystring
>
> That's totally not going to work. The rendertag is evaluated prior to 
> publication and can'tinteract with a client session.
>
> Regards,
> Richard.
>
> Sent from my mobile. Sorry if it's brief.
>
> Andry Poernomo <[email protected]> wrote:
>
> Hi Richard,
>
> I'm trying to build an A-Z index page. Something
like:http://find.curtin.edu.au/indexaz/index.cfm.
>
> The query string will be on each link from A to Z. Ie. <a 
> href="?index=A">A</a> <a href="?index=B">B</a> and so on. The page 
> will then load the following navigation
>
> <reddot:cms>
>     <if>
>         <query valuea="Context:CurrentIndex.Headline.Substring(Int:0,
> Int:1).ToUpper()" operator="==" valueb="QueryString("index") here">
>             <htmltext>
>                 <li><a href="<%!! Context:CurrentIndex.GetUrl() !!%>"><%!!
> Context:CurrentIndex.Headline !!%></a></li>
>                 <navigation:nextlevel>
>             </htmltext>
>         </query>
>     </if>
> </reddot:cms>
>
> The <li> will then be sorted using a javascript.
>
> Doesn't sound like a good plan, does it... Any good advice on how I 
> should implement this?
>
> Andry
>
>
>
>
>
>
>
> -----Original Message-----
> From: [email protected]
>
> [mailto:[email protected]] On Behalf Of Richard Hauer
> Sent: Monday, 14 November 2011 7:38 PM
> To: [email protected]
> Subject: RE: RedDot <if> statement and querystring
>
> You might have more luck replacing
>   Response.QueryString("A")
> with
>   System.Web.HttpContext.Current.Request.QueryString("A")
>
> I'm still not sure it will work because the render tags are being 
> executed in a Windows Service and don't have access to the HttpContext
object.
> Or that's my guess anyways - worth a try.
>
> Conceptually though you're not really doing the right thing anyway - 
> what querystring are you trying to read? Runtime? SmartEdit? SmartTree?
Preview?
> PreExecute? RDExecute? They're all different.
> I suspect you're trying to do something you simply can't do and you'd 
> be better off putting your question to the group by starting with what 
> you're actually trying to do.
>
> Regards,
> Richard Hauer
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Andry
> Sent: Monday, 14 November 2011 10:29 PM
> To: RedDot CMS Users
> Subject: RedDot <if> statement and querystring
>
> Hi guys,
>
> Has anyone worked with a combination of reddot <if> statement and 
> querystring before?
>
> I need to create an A-Z index page and page search by category.
>
> something like...
>
> <reddot:cms>
>     <if>
>         <query valuea="Context:CurrentIndex.Headline.Substring(Int:0,
> Int:1).ToUpper()" operator="==" valueb="<% Response.QueryString("A") %>"
>             <htmltext>
>                 <li><a href="<%!! Context:CurrentIndex.GetUrl() !!%>"><
%!!
> Context:CurrentIndex.Headline !!%></a></li>
>                 <navigation:nextlevel>
>             </htmltext>
>         </query>
>     </if>
> </reddot:cms>
>
> Thanks guys... :)
>
> Andry
>
> --
> You received this message because you are subscribed to the Google 
> Groups "RedDot CMS Users" group.
> 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
athttp://groups.google.com/group/reddot-cms-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google 
> Groups "RedDot CMS Users" group.
> 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
athttp://groups.google.com/group/reddot-cms-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google 
> Groups "RedDot CMS Users" group.
> 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
athttp://groups.google.com/group/reddot-cms-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google 
> Groups "RedDot CMS Users" group.
> 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
athttp://groups.google.com/group/reddot-cms-users?hl=en.

--
You received this message because you are subscribed to the Google Groups
"RedDot CMS Users" group.
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.

-- 
You received this message because you are subscribed to the Google Groups 
"RedDot CMS Users" group.
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