2

I'm pretty new to CFWheels, and I guess the answer to this question may be pretty obvious, but please bear with me. I'm trying to include shared/loginregister as a partial on my layout page. However, I keep getting this ColdFusion error:

Could not find the included template ../../views/home/shared/_loginregister.cfm. Even though i am using an absolute path.

My understanding was that all I had to do was place the partial _loginregister.cfm in a shared folder that is in the root view folder as this image shows: Shared folder in views root. Then use the code #includePartial(partial="/shared/loginRegister")# to access that page. What I'm hoping to achieve is to be able to submit params to a global controller/ that can be shared by the different controllers as the login/register menu option is in the layout page and appears on every page. I'm also hoping to do this for my cart as well.

Here is a snippet of code from my controller. I've currently placed the controller code for this partial in the default Controller.cfc file.

<cffunction name="newUser" access="remote" hint="connects to users database">

    <cfset user = model("user").new() />

    <cfdump var="user"><cfabort>
</cffunction>

Here is a snippet of code as it currently stands in my layout page code below:

    <header>
        <nav>
            <div class="relative">
                <div class="social_wrapper absolute">
                    <p>Join Us</p>
                    <a href="##"><span class="facebook sprite"></span></a>
                    <a href="##"><span class="twitter sprite"></span></a>
                    <a href="##"><span class="instagram sprite"></span></a>
                </div>
                <div class="auth_wrapper absolute">
                    <a href="##sign_in">Sign In</a> / <a href="##register">Register</a> <a href=""><span class="caddy sprite"></span> (0)</a>
                    #includePartial(partial="/shared/loginRegister")#
                    <div>
                        <input class="search_input" type="text" name="search" placeholder="I am searching for" value=""><!---
                        ---><button class="search_icon search_btn" type="submit" name="search"></button>
                    </div>
                </div>
            </div>
       </nav>
   </header>

Any information on how to do this would be great.

Community
  • 1
  • 1
  • Where is your layout file, the code of which you have shown? You should use the layout.cfm file in the root of the views folder. – Pankaj Dec 06 '15 at 20:07
  • From error message it looks you are not using default layout file (available in root folder). so there is some problem with your path itself. please post correct location of layout and include file. – Keshav jha Dec 07 '15 at 08:35
  • the layout file is in the root of the views folder. i noticed that the issue seems to have been resolved now. i used #includePartial(partial="/shared/loginRegister")# and that resolved my issue as this was what i was using before i have no idea as to why the issue came up in the first place. another issue i'm facing though is how i get my partial to interact with the controller.cfc file. when submit the partial form it asks me to create a view for the action. any help in this area will be deeply appreciated. – user2982480 Dec 09 '15 at 05:28
  • I have not looked at this code in a while now and will be going back to it later today, but I resolved this issue by placing the action method in the base controller.cfc that extends wheels.cfc. – user2982480 Feb 03 '16 at 14:31

0 Answers0