We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40067
    • 7 Posts
    Hello, I'm new to both to MODx and these forums, so I apologize if it's not the right section of forums to ask this. I'm following Mary's tutorial on http://codingpad.maryspad.com/2010/08/18/modx-revolution-for-beginners-part-1-introduction/
    Just to mention, I'm using a free template - http://www.css3templates.co.uk/templates/CSS3_four/index.html
    I'm doing everything on local server, using Wamp 2.2

    First of all, I can't seem to make my Wayfinder work. At first, it displayed 2 menus, like a menu and a copy of it, after some editing, I fixed it, but formating was nonexistent.(Before that formating was nonexistent as well) Even more, when I looked at source, it still displayed 2 copies of it
    I'd much appreciate if anyone could point me where am I making a mistake.

    Original menu code in:
    <nav>
            <div id="menu_container">
              <ul class="sf-menu" id="nav">
                <li class="selected"><a href="index.html">Home</a></li>
                <li><a href="examples.html">Examples</a></li>
                <li><a href="page.html">A Page</a></li>
                <li><a href="another_page.html">Another Page</a></li>
                <li><a href="#">Example Drop Down</a>
                  <ul>
                    <li><a href="#">Drop Down One</a></li>
                    <li><a href="#">Drop Down Two</a>
                      <ul>
                        <li><a href="#">Sub Drop Down One</a></li>
                        <li><a href="#">Sub Drop Down Two</a></li>
                        <li><a href="#">Sub Drop Down Three</a></li>
                        <li><a href="#">Sub Drop Down Four</a></li>
                        <li><a href="#">Sub Drop Down Five</a></li>
                      </ul>
                    </li>
                    <li><a href="#">Drop Down Three</a></li>
                    <li><a href="#">Drop Down Four</a></li>
                    <li><a href="#">Drop Down Five</a></li>
                  </ul>
                </li>
                <li><a href="contact.php">Contact Us</a></li>
              </ul>
            </div>
          </nav>


    My chunks:

    XionOuter:
    <[[+wf.clasess]]>
    <div[[+wf.classes]]>[[+wf.wrapper]]</div>
    <ul class="sf-menu">[[+wf.wrapper]]<ul id="nav"[[+wf.classes]]>[[+wf.wrapper]]>


    XionInner:
    <ul>[[+wf.wrapper]]</ul>


    XionInnerRow:
    <li [[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>


    XionMenuRow:
    <li [[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>


    ----
    And my Wayfinder call:
    [[!Wayfinder?
    	  &startId=`0`
    	  &outerTpl=`XionOuter`
    	  &rowTpl=`XionMenuRow`
    	  &innerTpl=`XionInner`
    	  &innerRowTpl=`XionInnerRow`
    	  &firstClass =``
    	  &lastClass =`` ]]    



    After not being able to solve issues with Wayfinder, I moved on further to FormIt.
    I followed tutorial as it said, but in the end I'd not make it work.
    I did read somewhere that sometimes form won't send if you're local server like Wamp.
    But how else can I test it?
    Oh, I did go ahead of myself and tried to add reCaptcha and then a mysterious error in a shape of table appeared, I will add that as attachment.
    Either way, I'm going to post my code, perhaps it's an error on my part, rather than it not working on local server.

    Original form without PHP in it:
    <form id="contact" action="contact.php" method="post">
              <div class="form_settings">
                <p><span>Name</span><input class="contact" type="text" name="your_name" value="" /></p>
                <p><span>Email Address</span><input class="contact" type="text" name="your_email" value="" /></p>
                <p><span>Message</span><textarea class="contact textarea" rows="5" cols="50" name="your_message"></textarea></p>
                <p style="line-height: 1.7em;">To help prevent spam, please enter the answer to this question:</p>
                <p><span>4 + 8 = ?</span><input type="text" name="user_answer" /><input type="hidden" name="answer" value="4d76fe9775" /></p>
                <p style="padding-top: 15px"><span> </span><input class="submit" type="submit" name="contact_submitted" value="send" /></p>
              </div>
            </form>


    Form after editing:
    <form id="contact" action="[[~[[*id]]]]" method="post">
                <div class="form_settings">
                <p><span>Name</span><input class="contact" type="text" name="contact_name" value="[[!+fi.contact_name]]" /></p>
                <p><span>Email Address</span><input class="contact" type="text" name="contact_email" value="[[!+fi.contact_email]]" /></p>
                <p><span>Message</span><textarea class="contact textarea" rows="5" cols="50" name="contact_message">[[!+fi.contact_message]]</textarea></p>
                [[+formit.recaptcha_html]]
    	    [[!+fi.error.recaptcha]]
                <p style="padding-top: 15px"><span> </span><input class="submit" type="submit" name="contact_submitted" value="send" /></p>
                           </div>
            </form>


    FormIt call:
    [[!FormIt?
    	&hooks=`recaptcha,spam,email`
    	&emailTpl=`sentEmailTpl`
    	&emailSubject=`Message from Learn MODx Revo Website`
    	&emailTo=`[email protected]`
            	&validate=`contact_name:required:minLength=`2`,
    	      contact_email:email:required,
    	      contact_message:required`
            &redirectTo=`44`
            &fiarTpl=`autoResponseTpl`
    	&fiarSubject=`Thank You for Contacting Us`
    	&fiarToField=`contact_email`
    	&fiarFromName=`Learn MODx Website`
                           ]]
    


    And my "sentEmailTpl" chunk:
    [[+contact_name]] left you the message below on the Learn MODx Revolution website: <br />
    	<strong>[[+contact_message]]</strong><br />
    	You can respond to [[+contact_name]] by email at <a href="mailto:[[+contact_email]]">[[+contact_email]]</a> 


    As you may have noticed, I didn't change text anywhere(from tutorial), because since I had problems with Wayfinder beforehand, I wasn't too optimistic about making this work either, I wanted to be sure that it works before I edit anything, since it'd be an wasted effort.

    I don't want to leave an impression, that I didn't bother trying to understand and fix things, because I did, spent countless hours reading official documentation, looking at examples, everything really. Perhaps it's my lack of knowledge in general regarding HTML and coding, but I do want to understand.
      • 22427
      • 793 Posts
      Wayfinder:
      Your chunk XionOuter is rather messed up. The [[+wf.wrapper]] appears several times, so you get the multiple output of the menu. And you have the <ul> twice, but the terminating </ul> is missing.

      Try this:
      <ul class="sf-menu" id="nav">[[+wf.wrapper]]</ul>
      
        • 40067
        • 7 Posts
        Thank you! That solved it. What confused me for the most part, was that there is both class and an id and some other tags in original menu. Thanks again, much appreciated!