We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

need embed variable solution

Development and Programming

Cosly.com's avatar
Cosly.com
8 posts
14 years ago
Cosly.com's avatar Cosly.com

Hello everybody,

I need a solution for something that is not working in the way I want.

<h5>
Blogpost written by {exp:channel:entries channel="colleagues"}{title}{/exp:channel:entries}
</h5>

{exp:channel:entries channel="blog" dynamic="no" 

author_id="{exp:channel:entries channel="colleagues"}{employee_id}{/exp:channel:entries}"}

{exp:channel_images:images entry_id="{entry_id}"}

<h1><a href="http://{title_permalink">{title}</a></h1>
{exp:excerpt limit="20"}{blog-artikel}{/exp:excerpt}...
{/exp:channel:entries}

It’s the author_id where it goes wrong.

I tried a couples of things but none of them worked.

Any ideas?

Thanks.

       
jimdoescode's avatar
jimdoescode
19 posts
14 years ago
jimdoescode's avatar jimdoescode

You can’t use the channel entries tag the way you are using it. You should probably use PHP to store the employee id value. I am not sure how you have things setup but it seems like this could be a place to create a relationship and use ee’s built in relationship tags.

If you want to go the PHP route the code should look something like this:

Blogpost written by {exp:channel:entries channel="colleagues"}{title}
<?php $employee_id = '{employee_id}';?>
{/exp:channel:entries}

{exp:channel:entries channel="blog" dynamic="no" author_id='<?=$employee_id;?>'}

.......
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.