Dropdown not working

67 views
Skip to first unread message

Sean

unread,
Jun 12, 2012, 7:12:44 PM6/12/12
to reddot-c...@googlegroups.com
Hello everyone,

I am creating a dropdown in page body area:

<ul id="dropdown_resourcecategories" class="dropdown">


    <li><!--<%resource_category_keyword%>-->
        <a href="#" onclick="$(this).next().slideToggle('medium');return false;"><%!! Escape:Text(<%resource_category_keyword%>).ToString() !!%></a>  
        <ul style="display:none;">
<!IoRangeList>
            <li><a href="<%list_resource_pages%>">
 
<reddot:cms> 
<htmlext>
<%!! Context:CurrentPage.Elements.GetElement(container_page_body).Value[Int:0].Elements.GetElement(resource_category_keyword).GetHtml() !!%> 
</htmltext>
</reddot:cms> 
             </a></li>
<!/IoRangeList>
        </ul>
                  
    </li>

</ul>

When I click the dropdown, the 6 items all shows blank, that means the following part is not working:

<%!! Context:CurrentPage.Elements.GetElement(container_page_body).Value[Int:0].Elements.GetElement(resource_category_keyword).GetHtml() !!%> 

Does anyone know why? Thanks

Gavin Cope

unread,
Jun 12, 2012, 7:23:27 PM6/12/12
to reddot-c...@googlegroups.com
I assume your placeholder is an info placeholder. You can't retrieve info placeholders using render tags.

Cheers,

Gavin

--
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/-/t8UnD34dUDgJ.
To post to this group, send email to reddot-c...@googlegroups.com.
To unsubscribe from this group, send email to reddot-cms-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/reddot-cms-users?hl=en.

siner zxa

unread,
Jun 12, 2012, 7:51:33 PM6/12/12
to reddot-c...@googlegroups.com
Thanks Gavin,

You are right. It is info keyword.

I changed it to Option List, and still no joy.

Do you have any clue?

Thank you in advance.

Sean

Gavin Cope

unread,
Jun 12, 2012, 8:04:24 PM6/12/12
to reddot-c...@googlegroups.com
I'm just going by memory here so this may be wrong but try this:
<%!! Context:CurrentPage.Elements.GetElement(container_page_body).Value[Int32:0].Elements.GetElement(resource_category_keyword).Value !!%>

Also, try creating the option list placeholder from scratch as if you're using the same placeholder name, there may be caching issues.

Cheers,

Gavin

Sean

unread,
Jun 13, 2012, 1:28:03 PM6/13/12
to reddot-c...@googlegroups.com
Thanks Gavin,

I tried and found the problem!

Context:CurrentPage is referring to the page in container_page_body, not the foundation page. But the url in dropdown is the url of foundation page, that is correct:

<!IoRangeList>
            <li><a href="<%list_resource_pages%>">aaaaaaaa
            <%!! Context:CurrentPage.Elements.GetElement(resource_category).Value !!%> 
             </a></li>
<!/IoRangeList>

I am defining same keyword for those foundation pages and the container.

Please help!

Sean
Sean


To post to this group, send email to reddot-cms-users@googlegroups.com.
To unsubscribe from this group, send email to reddot-cms-users+unsubscribe@googlegroups.com.

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 reddot-cms-users@googlegroups.com.
To unsubscribe from this group, send email to reddot-cms-users+unsubscribe@googlegroups.com.

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 reddot-cms-users@googlegroups.com.
To unsubscribe from this group, send email to reddot-cms-users+unsubscribe@googlegroups.com.

Sean

unread,
Jun 13, 2012, 4:12:18 PM6/13/12
to reddot-c...@googlegroups.com
Hello Gavin,

Here is my situation:

Foundation Page F1, F2, F3, F4, F5, of same content class F.

There is a container container_page_body in F's template.

Page Body B1, B2, B3, B4, B5. linked to the container in F1-F5.

In template of content class B, there is a list for dropdown, now there are 5 items populated in list, and url is pointing to F1-F5 pages.

In template of content class B, there is a option list element "resource_category".

I wish to show value of resource_category in dropdown test:

<li>
     <a href="<%list_resource_pages%>">aaaaaaaa
            <%!! Context:CurrentPage.Elements.GetElement(container_page_body).Value[Int32:0].Elements.GetElement(resource_category).Value  !!%> 
     </a>
</li>

Because the list list_resource_pages is not in foundation page, I cannot use Context:CurrentPage to access the linked foundation page, right?

Do you have any clue where I am wrong?

Thank you in advance

Nik S.

unread,
Jun 13, 2012, 6:20:53 PM6/13/12
to reddot-c...@googlegroups.com
Hey Sean, 

I don't see any problem with your code - syntactically, at least.  I think you may be battling cache; please see the following entry from Jian's blog:http://simplyreddot.blogspot.com/2012/03/rendertag-project-performance-product.html - particularly the second paragraph under ".Elements.GetElement(), .GetPathArray()".  You can clear the page cache by selecting the Project node under Administer Project Structure in SmartTree, and clicking on the Clear Page Cache link in the right Action Menu.  

Alternatively, you could pull through the value of the "resource_category" option list element via the List block marks; your code would look something like this: 

<!IoRangeList>
<li>
     <a href="<%list_resource_pages%>">aaaaaaaa
            <%!! Context:CurrentPage.Elements.GetElement(container_page_body).Value[Int32:0].Elements.GetElement(resource_category).Value  !!%> 
     </a>
</li>
<!/IoRangeList>

This way you're minimizing the time needed by MS to generate the page.  Is this a viable alternative?  

-Nik

siner zxa

unread,
Jun 13, 2012, 7:34:56 PM6/13/12
to reddot-c...@googlegroups.com
Thanks Nik,

I tried your suggestion, still no luck.

I found here  Context:CurrentPage is always referring to the same current page in the container, and  <a href="<%list_resource_pages%>">  is referring to foundation page as I wish.

What could I am doing wrong here?

Thank you.

Sean


--
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/-/XNRtA7JdIngJ.

To post to this group, send email to reddot-c...@googlegroups.com.
To unsubscribe from this group, send email to reddot-cms-use...@googlegroups.com.

Nik S.

unread,
Jun 14, 2012, 11:26:13 AM6/14/12
to reddot-c...@googlegroups.com
Hey Sean, 

Upon re-reading my post, I realized I made a mistake: if you're using List block marks, then there's no need for Render tags.  Your code should look something like this: 

<!IoRangeList>
<li>
     <a href="<%list_resource_pages%>"><%resource_category%></a>
</li>
<!/IoRangeList>

I'm sorry for the confusion.  Please test the new code and let me know if it works.  

-Nik

siner zxa

unread,
Jun 14, 2012, 11:58:27 AM6/14/12
to reddot-c...@googlegroups.com
Thank you Nik,

I just tried, still no luck.

It is showing 5 dropdown items with same value as the value in resource_category of current page body, the 5 items are correct, the href urls are correct, only the texts in <a></a> are not correct.

If the dropdown and the list are in the foundation page, then I believe your new code will work, but now dropdown + list are in page body.

In the list_resource_category properties, I do check "transfer content" and "insert name only".

Thank you again for your help

Sean



-Nik

--
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/-/csd9vtvSVlMJ.
Reply all
Reply to author
Forward
0 new messages