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.

Simple simple simple question.

September 18, 2013 12:28am

Subscribe [2]
  • #1 / Sep 18, 2013 12:28am

    Victor Paredes

    7 posts

    Hey all. I’m very new to ExpressionEngine. So far I really like it. I’ve been searching around for this answer and haven’t found anything.

    I’m attempting to link directly to a particular entry. I figure the best way to do this is to pass a php variable through via a url (e.g. [...]/portfolio/index.php?entryid=5). And then call the entry using the standard code:

    <?php $_GET["entryid"] ?>

    I have enabled php in this particular template already. I’m also concerned that that there is a more efficient way to accomplish this task natively within ExpressionEngine. Please let me know if you guys can maybe give me a pointer in the right direction?

    My current code is as follows. The key line comes directly after the snippet {header} tag.

    <html>
    <head>
    
    {exp:channel:entries channel="portfolio_pages"}
    <title>Paredes Creative • {project_client} | {project_category}</title>
    {/exp:channel:entries}
    
       {headincludes} <!-- Includes style sheets, typekit -->
    
    </head>
    <body>
    
    
    {header}
    
    
    {exp:channel:entries channel="portfolio_pages" entry_id="<?php $_GET["entryid"] ?>"}
    
    
       <div class="portfolio_highlight"  url('{project_highlight}');"></div>
    
       <div class="portfolio_headline">
          <div class="p_title">
             {project_client}
          </div>
          <div class="p_category">
             {project_category}
             
          </div>
       </div>
    
       <div class="breakfloat"></div>
    
       <div class="index_content_wrapper">   
          {project_description}
    
    
       </div>
    
       <div class="center">
          {project_image_1}
          {project_image_2}
       </div>
    
    {/exp:channel:entries}
    
    
    
    
    </body>
    </html>

    I appreciate the assistance!

  • #2 / Sep 18, 2013 12:52pm

    Jeremy S.

    353 posts

    I may not be fully understanding your goal, but have you reviewed the docs here:

    http://ellislab.com/expressionengine/user-guide/modules/comment/#entry-id

  • #3 / Sep 19, 2013 11:51am

    Boyink!

    5011 posts

    After years of working with EE I can count on two hands the number of times I’ve needed PHP in a template.

    There are a number of linking variables to use, either via entry_id (unique in the install, but not a pretty URL) or via url_title (unique within a channel, and a prettier url).

  • #4 / Sep 23, 2013 6:51pm

    Victor Paredes

    7 posts

    Thanks, Boyink!

    I actually purchased your book, Building an ExpressionEngine 2 Site - Small Business and I’m taking a look at it now. I think this should help me get up to speed with ExpressionEngine. Great work and thanks for the reply!

    Best,
    Vic

  • #5 / Sep 23, 2013 6:54pm

    Boyink!

    5011 posts

    Thanks - much appreciated…;)

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

ExpressionEngine News!

#eecms, #events, #releases