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.

Does each page need a unique template?

July 22, 2011 2:08pm

Subscribe [1]
  • #1 / Jul 22, 2011 2:08pm

    Alex Boese

    125 posts

    I’ve run into a problem using the pages module. Probably something stupid I’m doing, but I can’t figure out what.

    I have two separate pages (channel entries), to each of which I’ve assigned a unique page URL. For the sake of simplicity, let’s say those URLs are:

    xxx/sheep

    and

    xxx/elephants

    I’m using the same template for each entry, and whichever URL I go to, only the page for xxx/sheep is displayed.

    I thought that EE would know from the URL which entry to display, but apparently not. So does each page need to point to a unique template? I’m confused. How am I supposed to pass the correct entry_id data to the template?

  • #2 / Jul 22, 2011 3:12pm

    Alex Boese

    125 posts

    Hmm. I created separate templates for each page. And I checked and double-checked that each entry is assigned a different URI. Yet still, no matter which of the two URLs I go to in my browser, the sheep page is displayed. It’s as if the pages module is fixated on the sheep.

    Could something have gotten mixed up in the mysql database? Any help would be appreciated.

  • #3 / Jul 22, 2011 3:14pm

    Please post your opening exp:channel:entries tag along with the parameters you’re using, it’ll make it much easier to troubleshoot.

  • #4 / Jul 22, 2011 3:17pm

    Alex Boese

    125 posts

    The tag I’m using is:

    {exp:channel:entries channel="admin" limit="1" disable="member_data" show_pages="only" status="bks"}
  • #5 / Jul 22, 2011 3:35pm

    Alex Boese

    125 posts

    Your query about the opening tag inspired me to start fiddling around with it, and from my fiddling it appears that the problem is somehow connected with my use of the status parameter. If I have each entry using a separate template AND assigned to a separate status (“open” and “bks”), then the pages display correctly when I go to the respective URLs.

    But if I have the two entries share the same status (whether that status is “open” or “bks”), then the problem starts and both URLs will show the sheep page. Weird!

  • #6 / Jul 22, 2011 7:11pm

    Weird indeed.  I wonder if it’s a bug?

  • #7 / Jul 22, 2011 7:53pm

    Alex Boese

    125 posts

    That’s what I’m thinking. But in the meantime, I’ve managed to get it to do what I want, so I’m not going to mess with it anymore. Thanks for your help!

  • #8 / Jul 22, 2011 8:52pm

    Lisa Wess

    20502 posts

    Remove this parameter:

    show_pages="only"

    it essentially stops the tag from looking at the URL, much like dynamic=“no” would work, as mentioned in the docs.

  • #9 / Jul 23, 2011 1:56am

    Alex Boese

    125 posts

    Thanks, Lisa. I guess I was confused. I misinterpreted the line in the docs about that parameter that says, “You can also set it to “only” and only show those entries that have had Pages assigned to them.” I thought that meant that by using the show_pages=“only” parameter I was making sure the tag would work only with entries being routed through the pages module.

  • #10 / Jul 23, 2011 11:10pm

    Lisa Wess

    20502 posts

    This parameter is intended for building a simple menu of Pages, hence the “only” option - but that’s also why it turns dynamic off.

    Does that help explain?

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

ExpressionEngine News!

#eecms, #events, #releases