RE: Whats the difference?

thumbnail
Achmed Tyrannus Albab, modified 5 Years ago. Regular Member Posts: 158 Join Date: 3/5/10 Recent Posts
Hi,
May i know whats the difference of these variables :
    ${site_default_public_url}
    ${community_default_public_url}
    ${site_default_url}
    ${community_default_url}

In the sense when to use which?
Because i tried outputting it on my theme, and all 4 outputs the same URL.

Thanks.
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
I would set the theme on your private pages and check the difference, I think you'll see one there.


The community ones I'm not sure about, they might be holdover variable names from previous portal versions.
thumbnail
Achmed Tyrannus Albab, modified 5 Years ago. Regular Member Posts: 158 Join Date: 3/5/10 Recent Posts
Thanks David, will give it a try later. I dont use private pages much.
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
You could check the init.ftl (you can find it in the build/templates folder after you build your theme war). It contains the definitions of those variables.

...
    site_default_public_url = htmlUtil.escape(page_group.getDisplayURL(theme_display, false))
    community_default_public_url = site_default_public_url
    site_default_private_url = htmlUtil.escape(page_group.getDisplayURL(theme_display, true))
    community_default_private_url = site_default_private_url
    site_default_url = site_default_public_url
    community_default_url = site_default_url
/>
<#if layout.isPrivateLayout()>
    <#assign
        site_default_url = site_default_private_url
        community_default_url = site_default_url
    />
<!--#if-->