Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Does "CurrentSiteName" macro name exists? View modes: 
User avatar
Member
Member
m.rutter - 9/15/2009 5:46:55 AM
   
Does "CurrentSiteName" macro name exists?
Hi everybody,
I'm trying to use the following macro expression:

{%CurrentSiteName%}

to get the current site code name (to be used within the href attribute of link tag).

The macro is resolved to an empty string (it isn't resolved at all, I think).
Does exists such a macro? Should I implement a custom macro instead?

Thank you.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/15/2009 11:18:42 AM
   
RE:Does "CurrentSiteName" macro name exists?
Hi,

Where you want to use the macro expression?

Could you please try to use this:
{%cmscontext.currentsite.sitename%}
?

For example, when editing web parts in portal engine, you can click on the small black arrow richt next to the property name and macro editor will be displayed, where you can "build" a macro for a walue you want to have. For more details please see Macro expressions article.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
m.rutter - 9/15/2009 12:06:31 PM
   
RE:Does "CurrentSiteName" macro name exists?
Hi Juraj,
thank you for your answer. Your tip works fine even if, in the meantime, I implemented a custom macro (I will revert my changes).

I already read the document you mentioned (Appendix A - Macro expressions) and I tried anything before posting.

According to the following document http://devnet.kentico.com/docs/4_1/devguide/cmscontext_class.htm which explains CMSContext class I was trying to use CMSContext.CurrentSiteName (even specifying the full namespace) but it does not work.

Thank you.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/15/2009 2:45:45 PM
   
RE:Does "CurrentSiteName" macro name exists?
Hi,

That is strange, I have tried to use CMS.CMSHelper.CMSContext.CurrentSiteName in the code and it is returning correct values.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
m.rutter - 9/16/2009 2:04:00 AM
   
RE:Does "CurrentSiteName" macro name exists?
Hi Juraj,
may be I made some mistake! I tried more then once using complete and partial namespace. I will try once again to avoid incorrect information.

Thank you for your support.