Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Webpart WHERE condition View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
emanuele.firmani-aduno-gruppe - 2/1/2010 2:54:07 AM
   
Webpart WHERE condition
I'm trying to customize the WHERE condition of the Menu webpart by inserting the following condition:
NodeParentID = {%currentpageinfo.nodeid%}

I was able to write the condition as
NodeParentID = 24
and it works.

How can I retrieve the information regarding the current tree node id?

Many thanks
Regards
Emanuele Firmani

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 2/1/2010 5:12:41 AM
   
RE:Webpart WHERE condition
Hello,

I tried the following macro expression and it works without probems:

NodeParentID = {%currentpageinfo.nodeparentid%}

Could you please describe, what are you trying to achieve?

Best regards,
Boris Pocatko

User avatar
Certified Developer v7
Certified  Developer v7
emanuele.firmani-aduno-gruppe - 2/1/2010 6:55:09 AM
   
RE:Webpart WHERE condition
I'd like to use two menu webparts, the first showing only the first level pages, the other one the second level pages.

I need that WHERE condition to select which are the children of the current active page.

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 2/6/2010 4:14:29 AM
   
RE:Webpart WHERE condition
Hi Emanuele,

If you want to display children of current page in menu you can use following path instead of where condition:

./%

Best Regards,

Martin Dobsicek

User avatar
Certified Developer v7
Certified  Developer v7
emanuele.firmani-aduno-gruppe - 2/8/2010 3:09:30 AM
   
RE:Webpart WHERE condition
I had also to add the flag: show only exact path.
It worked, thanks.

By the way, is it possible to use Kentico reserved words in the WHERE condition?

Many thanks
Regards
Emanuele Firmani

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 2/13/2010 12:44:43 PM
   
RE:Webpart WHERE condition
Hi Emanuele,

I'm not sure what exactly you mean by 'reserved words'. If you mean macros, they are supported in WhereCondition property of web parts.

Best Regards,

Martin Dobsicek

User avatar
Certified Developer v7
Certified  Developer v7
emanuele.firmani-aduno-gruppe - 2/15/2010 2:23:40 AM
   
RE:Webpart WHERE condition
Yes, you're right: I mean macros.
I think macros are not supported in WHERE conditions. I made two tests using the out-of-the-box navigation webpart:
- in the first I wrote the condition NodeParentID = 24 and it worked out
- in the second I wrote NodeParentID = {%currentpageinfo.nodeparentid%} but i got an SQL exception explaining me that {% is not allowed

Please, let me know if you were able to replicate the same issue.
Thanks
Regards
Emanuele Firmani

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 2/15/2010 8:18:28 AM
   
RE:Webpart WHERE condition
Hello,

Actually this should work fine, I've tested it. Context macros are allowed within webpart properties: http://devnet.kentico.com/docs/devguide/appendix_a___macro_expressions.htm.

Could you please provide us with your menu properties? Is it Drop-down menu webpart?

Could you please let us know exact error message you are receiving? Screenshot would be greatly appreciated.

Best regards
Ondrej Vasil