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.

Custom Fields & Pages

January 08, 2009 10:59am

Subscribe [4]
  • #1 / Jan 08, 2009 10:59am

    Flying Dutchman

    22 posts

    Hi there

    Anyway, I have a blackout at the moment.

    I created a Custom Field Group and some Custom Field with the names “content” and “tumb”.
    After that, I created a Template for my single pages (single.php). I also created a page with the pages Module (my_work and under pages the url “/work/”) and gave it the right template (myblog/single.php).

    I added Content to my page fields for “content” and “tumb” (some Lorem Ipsum).

    I added…

    {exp:weblog:entries weblog="{my_weblog}" limit="1" rdf="off" disable="trackbacks"}
    {content}
    {/exp:weblog:entries}

    ...to my single page template.

    But anyway, It only shows the template without my content under “/index.php/work/”.
    I’m very confused… Did a lot of settings but it won’t work.

  • #2 / Jan 08, 2009 11:15am

    Tim Stackhouse

    62 posts

    A couple questions:

    Is {my_weblog} set to the correct weblog for your Pages module content?  Try replacing it with a direct reference to that weblog.  Secondly, you are missing a declaration in your {exp:weblog:entries} tag to display content from your “tumb” field.  You should have something like:

    {exp:weblog:entries weblog="pages_weblog" limit="1" rdf="off" disable="trackbacks"}
    {content}
    {tumb}
    {/exp:weblog:entries}
  • #3 / Jan 08, 2009 11:26am

    Sue Crocker

    26054 posts

    Thanks for the assist, Tim.

    Flying Dutchman, did that make sense?

    If you visit the non-pages URI, does it show correctly?

  • #4 / Jan 08, 2009 11:42am

    Flying Dutchman

    22 posts

    Is {my_weblog} set to the correct weblog for your Pages module content?  Try replacing it with a direct reference to that weblog.  Secondly, you are missing a declaration in your {exp:weblog:entries} tag to display content from your “tumb” field.  You should have something like:

    Yep, my_weblog set correct in header. I added only the {content} for test purposes. Do I have to take it all in for a working page?

    What do you mean with the non-page URI? Directly over indexphp to my post?

  • #5 / Jan 08, 2009 11:43am

    Sue Crocker

    26054 posts

    The link to your post without using the Pages module.

  • #6 / Jan 08, 2009 2:48pm

    Flying Dutchman

    22 posts

    That’s my problem. I didn’t find a possible way to find out this link to my post 😉
    There is no link to show the post or preview inside the template or i’m too dummy.

  • #7 / Jan 08, 2009 3:10pm

    Pascal Kriete

    2589 posts

    What Sue means, is accessing it through a standard EE url:

    http://example.com/index.php/templategroup/template/url_title
  • #8 / Jan 08, 2009 3:40pm

    Flying Dutchman

    22 posts

    Didn’t work *grml* everytime the same: my template without the content of my post.

    Edit: Tim, you’re right, it was the “my_weblog” which didn’t get replaced.
    Now it works.

    But I don’t understand why this work

    {embed="6pounder/header"}
                
             
                <div id="block_portfolio">
                    <div id="block_single">
                        {exp:weblog:entries weblog="6pounder" limit="1" rdf="off" disable="trackbacks"}
                            {content}
                        {/exp:weblog:entries} 
    
                    </div>
                </div>
            
    
    
    {embed="6pounder/footer"}

    and this not:

    {embed="6pounder/header"}
                
             
                <div id="block_portfolio">
                    <div id="block_single">
                        {exp:weblog:entries weblog="{my_weblog}" limit="1" rdf="off" disable="trackbacks"}
                            {content}
                        {/exp:weblog:entries} 
    
                    </div>
                </div>
            
    
    
    {embed="6pounder/footer"}

    Edit——

    I have the lines in my header:

    {assign_variable:my_weblog="6pounder"}
    {assign_variable:my_template_group="6pounder"}

  • #9 / Jan 08, 2009 3:48pm

    Pascal Kriete

    2589 posts

    You are not defining {my_weblog}.  You need to set the variable at the top of the template:

    {assign_variable:my_weblog="6pounder"}
  • #10 / Jan 08, 2009 3:50pm

    Flying Dutchman

    22 posts

    You are not defining {my_weblog}.  You need to set the variable at the top of the template:

    {assign_variable:my_weblog="6pounder"}

    Sorry, edited. The lines are in my header file already. But, how it looks, it will not be load before the content of my template file…

  • #11 / Jan 08, 2009 4:01pm

    Pascal Kriete

    2589 posts

    Embedded templates are processed at the end of the parsing stage.  Even without this, template variables are set on a per-template basis [docs].

    It’s really just a convenience thing.

    Make sense?

  • #12 / Jan 08, 2009 4:28pm

    Flying Dutchman

    22 posts

    Ok, clear, that makes sense 😉
    You see, I’m still familiar to Wordpress. I have to rethink.

    Thanks a lot. Now it’s clear.

  • #13 / Jan 08, 2009 4:32pm

    Ingmar

    29245 posts

    Glad to see that took care of things… Please come back anytime if you got further issues.

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

ExpressionEngine News!

#eecms, #events, #releases