Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hi,

I am facing a really weird problem. I tested all the CMS at XAMPP and it worked.

Today, I moving it to real server, I get bunch of problem...

I have create a dropdown menu by using following code:

Code: Select all
                           <cms:if k_is_page || k_is_folder >
                                <cms:if k_folder_name ><cms:set current_folder=k_folder_name /></cms:if>
                                <cms:if k_page_foldername ><cms:set current_folder=k_page_foldername /></cms:if>
                            </cms:if>
                           
                            <cms:folders hierarchical='1' extended_info='1'>
                                <cms:if k_level_start >
                                   <cms:set my_class2='' />
                                        <cms:if k_level='0'>
                                            <cms:set my_class2='class="orion-menu red"' />
                                        </cms:if>
                                <UL <cms:show my_class2 />></cms:if>
                                <cms:if k_element_start >
                           
                                    <cms:set my_class='' />
                                    <cms:if "<cms:is_ancestor parent=k_folder_name child=current_folder />" >
                                        <cms:set my_class='class="active"' />
                                    </cms:if>
                           
                                    <LI <cms:show my_class />>
                                    <a href="<cms:if k_folder_immediate_children>javascript:void(0)<cms:else /><cms:show k_folder_link/></cms:if>"><cms:show k_folder_title/></a>
                                </cms:if>
                                <cms:if k_element_end ></LI></cms:if>
                                <cms:if k_level_end ></UL></cms:if>
                            </cms:folders>
                           


Redirect page by using following code:

Code: Select all
<!-- if this is NOT a folder -->
                            <cms:if k_is_home>
                                <!-- list folders -->
                                <cms:folders hierarchical='1'>
                                    <!-- and redirect to the first folder that is not top-level -->
                                    <cms:if k_level='0' || k_level='1'>
                                        <cms:redirect url="<cms:show k_folder_link />" />
                                    </cms:if>
                                   
                                </cms:folders>
                            </cms:if>


Problem 1 :
If I created a menu, the first-level menu works fine. If I create second level menu, the page is all blank, a totally empty blank page.

Problem 2:
If I try to use the redirect code
Code: Select all
<cms:if k_level='0' || k_level='1'>
                                        <cms:redirect url="<cms:show k_folder_link />" />
                                    </cms:if>

It shows exactly like problem 1 did, a totally empty blank page.

Any idea on this?
Hi,

The code you posted shows that when one visits the 'home-view', she is redirected to the first folder of the template. I think that part should be working fine (you should see the URL changing automatically when you visit the home-page of the template).

What is not clear from your code is how you have implemented the 'folder-view' i.e. the code that gets executed on the page where the visitor was redirected to above.

Try putting this somewhere on your template -
Code: Select all
<cms:if k_is_folder>
   <h1>Folder view: <cms:show k_folder_name /></h1>
   <cms:dump />
</cms:if>

Does this change the blank page?
Please let me know. Thanks.
unfortunately, it does not change the blank page.

What should I do now? I am definitely going to purchase a license for this project once it is officially launch on its hosting. I tested this CMS on XAMPP, it worked fine, when I move it to real server, problems come, :(
@KK,

I think you are right, it's the redirect problem, the folder/pages did created. It just won't link to the first page? example:

The masterpage: www.abc.com/products.php
The cloned page: www.abc.com/products.php?f=53

The cloned page did created but I just can't redirect it. It always show the masterpage www.abc.com/products.php which display empty page.
@nsy,

I logged-in and had a look at the problem (thanks for granting me access).

The problem was indeed with the redirect.
The reason turned out to be that your template was encoded as 'UTF8 with BOM' - the two infamous BOM bytes were messing up the redirect (you can find more here - viewtopic.php?f=4&t=53).

As a solution, I resaved the template in my text editor explicitly choosing 'UTF8 without BOM'.

Things are working now. Please verify and conform.

P.S.
Had to make a small correction to your following code -
Code: Select all
<!-- list folders -->
<cms:folders hierarchical='1'>
    <!-- and redirect to the first folder that is not top-level -->
    <cms:if k_level='1'>
        <cms:redirect url="<cms:show k_folder_link />" />
    </cms:if>
</cms:folders>

Made it -
Code: Select all
<cms:if k_is_home>
      <!-- list folders -->
    <cms:folders hierarchical='1'>
        <!-- and redirect to the first folder  -->
        <cms:redirect url="<cms:show k_folder_link />" />
    </cms:folders>
</cms:if>
Thanks, KK.

I just check the post, viewtopic.php?f=4&t=53.

Although I don't really understand what is BOM, but I follow the lead provided by @genxcoders. He deleted the empty space before <? php.....

But what I found is a few weird texts before <? php, I believed that is the marker you're talking about. I just deleted it, the website become well function.

I guess what you did with saving the file without BOM is just removing those marker. Just one question, those marker is useless, right? nothing lose if we just make the marker go away?
Hi, @nsy :)

What is your editor to code?
Try Notepad++. It is a great app and it can change codepage from utf-8 with bom to utf-8 without bom with 1 click.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
@nsy,

The principle is that *any* output before the opening PHP tag (i.e. <?php) will cause the mentioned problem - this output could consist of printable characters (like text) or non-printable characters (like spaces, newlines) or even characters that are totally invisible (like BOM).

BOM bytes are invisible - you cannot see them but they are there if the text file is encoded using plain 'utf8'. To remove them, we have to explicitly select 'utf8 without BOM' as encoding while saving the file (this is what I did in your case).

This choosing/changing the encoding option is provided by almost all text editors. As @trendoman suggested, one such editor we can recommend is Notepad++ (it is free and open-source).
@trendoman, @kk,

I am actually using Dreamweaver, it's ok, all you need to do just uncheck the bom signature, I can save the utf8 without bom using dreamweaver.

It just I never realized about this problem, I already using couch cms for several projects, none of them having this issues.

Any ways, thank for both of you. I really really appreciate your help. Now I can use couch cms for more projects :D :D
9 posts Page 1 of 1