Problems, need help? Have a tip or advice? Post it here.
8 posts Page 1 of 1
Hi. I noticed that I've got page without cms content if user is not logged in.

What to do to make it visible for all?

I have main index file and few other files to manage it.

Edit: Also every site have access level: Everyone
Hi,

If, as you say, the access is set to 'everyone', perhaps you have coded somewhere within the template itself some kind of access check?

Please do a recheck of the code. Feel free to paste the template here for us to to examine, if you so wish.

Thanks.
Hi, I dont think there is any access check.

Here is my index file: http://pastebin.com/sJY1fFjP
And section file: http://pastebin.com/9bPGfkVx
Hi,

You are right. The templates seem ok (except the use of cms:template twice).

Maybe something in the embedded snippets? e.g. lang_getter.html etc.

If your site has become available online, PM me the creds.

Thanks.
Thanks for the creds.

The title you used to describe the problem ("Blank page if user is not logged") is not accurate.
When a user is not logged-in, he does get to see the page - only some parts of the data are missing.

If you take a closer look at the portions of the data that are absent, you'll find that they are all outputted conditionally e.g.
Code: Select all
<cms:if my_lang='pl'><cms:show aboutus_content /></cms:if>
<cms:if my_lang='en'><cms:show aboutus_content_en /></cms:if>
<cms:if my_lang='de'><cms:show aboutus_content_de /></cms:if>

or
Code: Select all
<cms:if my_lang='pl'>Zobacz więcej</cms:if>
<cms:if my_lang='en'>See more</cms:if>
<cms:if my_lang='de'>mehr sehen</cms:if>

Evidently what is happening is that when a user is not logged-in, the 'my_lang' variable is not set to any value and hence no content is outputted.

Please review the part where you set the lang and see what is causing this to happen.

Thanks.
In lang_getter lang is set to 'pl'

But when I added <cms:set my_lang='pl' /> right after <?php require_once( 'couch/cms.php' ); ?> in index file I can't change language.

edit: I checked another time, I don't know what is wrong. :C
Your original code was -
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template >
<cms:embed 'lang_getter.html' />
..

Please modify it to make it as follows -
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:embed 'lang_getter.html' />
<cms:template >
...

You were embedding lang_getter.html from within cms:template tag and cms:template tag executes only for super-admins. Ergo the problem.

Move the embed outside to place it just before the opening tag of cms:template and that should do it.

Hope it helps.
WOW! That was super easy solution for my problem :)

Thanks alot!
8 posts Page 1 of 1
cron