ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Tutorial showing a Control Panel with Create Page option?

August 02, 2011 9:51pm

Subscribe [3]
  • #46 / Aug 12, 2011 9:24pm

    Dave @ Exp:resso

    465 posts

    Yep that sounds like one way to do it. Another way - and it depends on the budget of your project as to whether its worth it - is to use Matrix, an addon that lets you do exactly this, in a single entry

  • #47 / Aug 12, 2011 9:34pm

    svedish

    93 posts

    You mean that the addon would allow me to build the team members loop inside the team entry so that in the template I’d only need to output the team body copy?

  • #48 / Aug 12, 2011 9:36pm

    Dave @ Exp:resso

    465 posts

    Yep, matrix is perfect for things like this

  • #49 / Aug 12, 2011 9:39pm

    svedish

    93 posts

    Thanks!

  • #50 / Aug 12, 2011 10:11pm

    svedish

    93 posts

    Hi Dave,

    doesn’t seem to work. I now have this in my team template:

    <!--Start maincontent-->
    <div id="maincontent">
    
    {exp:channel:entries channel="content"}
    
    {if page_title != ""}
    <h3>{page_title}</h3>
    <p>{/if}</p>
    
    <p>{body_text}</p>
    
    <p>{/exp:channel:entries}</p>
    
    <p>A bit of text here</p>
    
    <p><br />
    {exp:channel:entries channel="team"}</p>
    
    <h3>team_member_name</h3>
    <p>team_member_position<br />
    team_member_biography<br />
    team_member_headshot</p>
    
    <p>{/exp:channel:entries}</p>
    
    <p><br />
    <!--End maincontent--><br />
    </div>

    The team members are not getting displayed.

  • #51 / Aug 12, 2011 10:23pm

    Dave @ Exp:resso

    465 posts

    Add dynamic=“no” to the team tag, should fix it

  • #52 / Aug 12, 2011 10:47pm

    svedish

    93 posts

    Lol, it did! Thanks.

    Understanding “Why” is going back to square one, to the core of the problem. Let’s see… In this case the URI is /team/, which is the URI of the “team” entry inside the content channel. This entry uses the template “team” inside the content template group. Now I could imagine that the URL was forcing EE to ‘focus’ on the single team entry of the content channel and this is why the second loop of my code requesting stuff from the ‘team’ channel was not displaying the entries of the team channel? So dynamic=“no” tells EE to forget what the URL is and to listen to the parameters inside the exp:channel:entries?

    I really hope I got it right because I have been trying to crack these core concepts for few days now and I see that I will never master this until I get this mechanism really clear in my mind. You were right, understaning the URLs is 80% of it.

    I also ask very specifically because I imagine this might be a common scenario and I’d like to have it really clear in my mind.

    In fact, imagine an aggregator type of page, like many home pages are nowadays. Imagine this home page displaying a banner, the home page text (which I’d just throw inside a site channel => home entry) and small series of entries from different channels, like the 3 most recent news from the news channel, two employees of the month from the employees channel, 3 featured portfolio projects from the portfolio channel and also 5 testimonials from the testimonials channel!

    I imagine all these would be separate {exp:channel:entries} calls with different parameters, right? I also imagine that this would be the home page, so I would not chose any URI for it, it would just be domain.com (no pages module acting in the backgroud).

    Would I be able to make all these channel:entries calls with total freedom or would EE not display anything (apart from the Home Page text) until I use dynamic=“no” on each of the other channel entries loops?

    I hope I am making sense becasuse in my head this is still a bit grey.

  • #53 / Aug 12, 2011 10:57pm

    Dave @ Exp:resso

    465 posts

    Yep you got it. By defualt, EE looks at the url to determine what to show in the channel entries loop. dynamic=“no” turns this behaviour off.

    Yep, on the homepage you’d have a number of channel entries tags, all with dynamic=“no”. It might work without dynamic=“no” on the homepage since theres no segments, but best just to put it in there anyway. Note that you can use caching, as well as disable=”” to improve efficiency. Also note that you can still create an entry in the content channel for the homepage, you’d just pull it specifically on the homepage with url_title=”” rather than having the url automatically find it.

  • #54 / Aug 12, 2011 11:09pm

    svedish

    93 posts

    Thanks God I’m getting at least some of it.

    And I also understand why it may work on a home page that makes no use of the URI (you mean that when you say “there’s no segment”, right?). It would work because EE would not be forced to ‘focus’ on one channel / entry. I also understand why it would be safer to just call dynamic=“no” on all the loop calls. It’s like specifying the limit=“1” also when the URI clearly indicates that you just want the fields of that specific static page. Better to be clear with ExpressionEngine in order to avoid surprises, even if this mean being redundant, right?

    I’d definitely create a home_page entry for that hypothetical Home Page. I’d put it’s “static” contents into it.

  • #55 / Aug 12, 2011 11:15pm

    Dave @ Exp:resso

    465 posts

    Yep, glad you’re starting to understand it all!

  • #56 / Aug 12, 2011 11:18pm

    svedish

    93 posts

    The good thing for the community is that I’m approaching the 100 posts. Soon I’ll be able to write the bloody documentation for this software. I’ll put it all in the notes! lol :D

    Thanks for all your help Dave. Have a great day.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases