Post Reply 
 
Thread Rating:
  • 264 Votes - 2.81 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(noob) [[*content]] field not working
08-26-2011, 05:23 AM (This post was last modified: 08-26-2011 06:19 AM by raindog.)
Post: #1
(noob) [[*content]] field not working
The hosting company I'm making a site for is on fatcow and I was told I can't upgrade to the most current version of MODx. I had to install MODx via simplescripts and I am using version MODx Revolution 2.0.6-pl2 (traditional).

I have a design started for this site, but am kind of designing as I go, so right now it is really rough.

The site is: http://www.welcometoperdition.com

Before I get into some wayfinder navigation troubleshooting questions, I'm having problems trying to figure out why the [[*content]] field isn't working. I have created a separate resource for each page I want, and have put some text in the 'Resource Content' as a placeholder to test it. I have the latest version of Revolution installed locally and am using the same code I am using on the live site (which works locally), but I can't figure out why it isn't working on the live site.

here is the code for that section (right now, the entire template has no chunks, tvs, snippets, etc. other than what i copied from the default base-template that ships with modx)

Code:
<div id="main" role="main">
        <div id="content_wrapper" class="container_12">
            [[*content]]
        </div>
    </div>

there should be the dummy content text that appears in a div under the top menu and just above the footer. I am also using HTML boilerplate.

any thoughts? thanks in advance!

- raindog

ps. I thought I'd also add to this post that I noticed that the page title tag isn't working either, it's almost as if none of the modx tags are working...i've obviously done something wrong. Sad

i've also tried to change it back to the default base template then switch it back to my template, but it still does not work.

(mary, your podcast is GREAT!!! can't wait to see more!)


Find all posts by this user
Quote this message in a reply
08-26-2011, 06:43 AM
Post: #2
RE: (noob) [[*content]] field not working
Welcome to the forums, glad you enjoy the tutorials Smile

Now from what I can tell looking at your site, it looks like your [[*content]] field IS working fine, unless I've misunderstood. I have attached a screenshot of what the page looks like on my end. And when I right-click and view source in the browser, I see as part of your page source the code:

Code:
</div>
        <!-- END TOP MENU -->
    </header>
    <div id="main" role="main">
        <div id="content_wrapper" class="container_12">
            <p>This is content for the home page.</p>
        </div>
    </div>
    <footer>
        <!-- BEGIN FOOTER -->

which seems to correspond well with the code you've quoted in your post. I assume you typed the text "This is the content for the home page" in the content field of your resource, and that replaced the [[*content]] tag in your template code.

Does that make sense, or have I totally misunderstood the issue?




Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
08-26-2011, 06:46 AM
Post: #3
RE: (noob) [[*content]] field not working
this is correct, but if you click any of the other links in the topnav the same content appears, for which, i have other placeholders for those resources (ie, 'this is the contact page')


Find all posts by this user
Quote this message in a reply
08-26-2011, 06:50 AM
Post: #4
RE: (noob) [[*content]] field not working
Hmm, are you using Wayfinder to generate those menu items or are they hard-coded, and if they're hard-coded, can you post the source here?

Have you enabled friendly urls on your site?


Find all posts by this user
Quote this message in a reply
08-26-2011, 06:54 AM (This post was last modified: 08-26-2011 07:37 AM by raindog.)
Post: #5
RE: (noob) [[*content]] field not working
this is all the html within the body (*excluding some html boilerplate javascript stuff which you can see in the view source)...but this is taken directly from the template in modx manager:

Code:
<div id="container">
    <header>
        <!-- BEGIN TOP MENU -->
        <div class="menutop_bg">
            <div id="menutop" class="container_12">
                <div><a href="" id="logo">Home</a></div>
                <div class="socialnet">
                    <a href="#" class="facebook">Facebook</a>
                    <a href="http://www.twitter.com/windfieldgreer" class="twitter" target="_blank">Twitter</a>        
                </div>
                [[!Wayfinder?startId=`0`!]]
            </div>
        </div>
        <!-- END TOP MENU -->
    </header>
    <div id="main" role="main">
        <div id="content_wrapper" class="container_12">
            [[*content]]
        </div>
    </div>
    <footer>
        <!-- BEGIN FOOTER -->
        <div class="clear"></div>
        <div id="footer" class="container_12">
            <div id="footer_content">
            <div id="navfooter">
                    [[!Wayfinder?startId=`0`!]]
                </div>
                <p>© [[Copyright]] James Greer - All Rights Reserved.</p>
                
            </div>
        </div>
        <!-- END FOOTER -->
    </footer>
  </div> <!--! end of #container -->

*edit...sorry i missed this. yes, i have enabled friendly URLs.
i think i screwed something up big time. i went into simplescripts in the control panel of fatcow and unistalled previous wordpress installs i tried out, and when i did it apparently deleted the index.php and possibly some other files along with the uninstall. i tried to download the same version of modx and unzipped it to upload the index.php that came with that, but that didn't work. i think i might have to completely reinstall on the server Sad

i am working locally...and now i have the same version as i have on the server to test locally. i think i will still have the same problem with the [[*content]] resource as i did before, but i'll let you know. i'm going to be using the same code to get me back to where i was before i screwed things up Smile

i'll post back when she's back online. *sorry


Find all posts by this user
Quote this message in a reply
08-26-2011, 08:15 AM
Post: #6
RE: (noob) [[*content]] field not working
ok...

reinstalled. and i think i have an idea as what the source of the problem is...i'm pretty sure it has something to do with the friendly URLs. i really would like to have friendly urls.

i might have set this up wrong, but all i did was turn it on in the manager. like before, the pages work, but, the [[*content]] for that wasn't.

any ideas?

sorry for the noob questions Blush


Find all posts by this user
Quote this message in a reply
08-26-2011, 09:29 AM
Post: #7
RE: (noob) [[*content]] field not working
i think i've narrowed the problem down more. i'm pretty sure that the friendly urls has something to do with the .htaccess file. as i mentioned, i'm on fatcow.com and i'm not sure if or how much i am able to change the .htaccess file. i've done it manually via ftp, and it kinda works, but sometimes i get a fatcow error page, but if you reload it the page shows up (very strange).

after i did this, i went into the control panel in fatcow to see if there was anything i can do in there. i took a screenshot to show you the 'tools' they have in their control panel to change the .htaccess file.

   

(also, i followed these instructions to see if it would work for modx: http://twistify.com/98/setting-up-friend...revolution)

when i added the:
Code:
RewriteBase /modx
i had an 'internal error' on the server...so i took the /modx off

-raindog


Find all posts by this user
Quote this message in a reply
08-26-2011, 10:42 AM
Post: #8
RE: (noob) [[*content]] field not working
Yes, definitely sounds like the friendly urls are the issue. If you enable friendly urls then you need a well configured .htaccess for them to work.

The MODx installation comes with a file called ht.access. If your installation is sitting in the root folder, which it seems to be in your case (as opposed to in a subdomain), you should be able to simply make a copy of that that ht.access file and rename it to .htaccess and your friendly urls should work just fine. You only need to add /foldername to RewriteBase if your installation is sitting in a folder called "foldername"

I've never worked with fatcow so not sure but I think you could just use ftp or your control server to copy and rename this file.

Good work troubleshooting this btw, sorry I popped offline for a while.

Let me know what progress you make


Find all posts by this user
Quote this message in a reply
08-26-2011, 06:57 PM (This post was last modified: 08-26-2011 06:58 PM by raindog.)
Post: #9
RE: (noob) [[*content]] field not working
Thanks Mary!

i did what you said. it is strange though because sometimes when you click one of the links it returns an error page but if you refresh then the site shows up normal with friendly urls. i'm sure there is some conflict that i need to tweak somewhere, but i'm not entirely sure where i should be looking for.

in the .htaccess file, towards the bottom, it says:
Code:
# If your server is not already configured as such, the following directive
# should be uncommented in order to set PHP's register_globals option to OFF.
# This closes a major security hole that is abused by most XSS (cross-site
# scripting) attacks. For more information: http://php.net/register_globals
#
# To verify that this option has been set to OFF, open the Manager and choose
# Reports -> System Info and then click the phpinfo() link. Do a Find on Page
# for "register_globals". The Local Value should be OFF. If the Master Value
# is OFF then you do not need this directive here.
#
# IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
#
# Your server does not allow PHP directives to be set via .htaccess. In that
# case you must make this change in your php.ini file instead. If you are
# using a commercial web host, contact the administrators for assistance in
# doing this. Not all servers allow local php.ini files, and they should
# include all PHP configurations (not just this one), or you will effectively
# reset everything to PHP defaults. Consult www.php.net for more detailed
# information about setting PHP directives.

#php_flag register_globals Off

i checked the 'register_globals' and they are 'off', so that isn't a problem i don't think...in the .htaccess. but i'm wondering about the php.ini file which is mentioned in the second part. do you think that could be the culprit for the irregularity of the links loading or not? (ie, either an fatcow error page, or the modx page)


thanks for your help mary! you rock!
(can't wait til' the next screencast!) Smile

i have some more questions regarding wayfinder and i'm totally lost on how to make some content sections dynamic that i want to setup. i'll post those separately not to confuse anyone who might find a solution for the problem i have had here.


Find all posts by this user
Quote this message in a reply
08-27-2011, 10:50 AM
Post: #10
RE: (noob) [[*content]] field not working
My first step with these kinds of issues is to look at the error logs, both the modx error log and the apache error log. You may be able to find a clue there as to what's causing the erratic behavior. Also, clear the site cache from the backend. Sometimes caching can cause all sorts of odd problems when you're doing dev work.

I don't think your issue has anything to do with register_globals. I would be more inclined to suspect the hosting environment. From perusing the official forums I know many users have often had issues with Fatcow, it doesn't seem to offer good support for MODx. So in terms of thinking ahead you may want to think about going for a hosting company that is known to work well with MODx.

One good test to run is you have this same identical site installed offline on your local development environment and see if you run into the same issues.


Find all posts by this user
Quote this message in a reply
08-28-2011, 02:19 AM
Post: #11
RE: (noob) [[*content]] field not working
thanks mary!

everything seems to be working perfectly now with the friendly urls. apparently when i went into the fatcow control panel and messed with the htaccess tools, there were other htaccess files added to the directory...i ftp'd into the site and deleted all the extra files and just left the modx htaccess file. now everything seems to be working fine.

i've also installed the same version of modx locally to test. Smile

i've posted new questions in the forum regarding wayfinder and trying to understand how to make parts dynamic.

thanks!

raindog


Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread:
1 Guest(s)

Return to TopReturn to Content