mvc include partial cfwheels ColdFusion Error: Could not find the included template

70 views
Skip to first unread message

Kema Akpala

unread,
Dec 6, 2015, 4:37:27 AM12/6/15
to CFWheels

I'm pretty new to CFWheels and I guess the answer to this question may be pretty obvious but please bare with me. I'm trying to include shared/loginregister as a partial on my layout page but 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 the image shows in the attachment.

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/ a controller that can be shared amongst the different controllers as the login/register menu option is in the layout page and appears on every page, i'll also be 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 greatful

sharedfolderinviewsroot.png

Kema Akpala

unread,
Dec 6, 2015, 4:37:29 AM12/6/15
to CFWheels

I'm pretty new to CFWheels and I guess the answer to this question may be pretty obvious but please bare with me. I'm trying to include shared/loginregister as a partial on my layout page but 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 the image shows below. 


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/ a controller that can be shared amongst the different controllers as the login/register menu option is in the layout page and appears on every page, i'll also be 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>

Simon Allard

unread,
Dec 6, 2015, 7:56:09 AM12/6/15
to cfwh...@googlegroups.com
Hi Kema,

If _loginRegister.cfm reside in the "/views/home/shared/" folder you can include it like that: #includePartial(partial="/home/shared/loginRegister")#

For absolute path, you have to specify everthing coming after the "views" folder/".

Hope it will help :)

A+ 
Simon

--
You received this message because you are subscribed to the Google Groups "CFWheels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfwheels+u...@googlegroups.com.
To post to this group, send email to cfwh...@googlegroups.com.
Visit this group at http://groups.google.com/group/cfwheels.
For more options, visit https://groups.google.com/d/optout.



--

Kema Akpala

unread,
Dec 9, 2015, 12:35:03 AM12/9/15
to CFWheels
Hi Simon,
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 I submit the partial form it asks me to create a view for the action. any help in this area will be deeply appreciated.

Chris Peters

unread,
Dec 9, 2015, 10:16:28 AM12/9/15
to cfwh...@googlegroups.com
What URL is your form submitting to? You'll need to create a controller and action to handle that.

Chris Peters
Web Developer
Liquifusion Studios

chris....@liquifusion.com
Skype: liquifusion.support
www.liquifusion.com
Reply all
Reply to author
Forward
0 new messages