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.

exp:channel:entries Search Parameter question

January 13, 2011 7:14pm

Subscribe [4]
  • #1 / Jan 13, 2011 7:14pm

    Justin Long

    196 posts

    I was able to figure out a workaround for my problem but I guess I just wanted to know what was causing the problem in the first place.

    A little background. I am build a site that use VZ Member to link a member to an entry. I want to offer a single URL that every user can go to and see their related entry. So I have created a template account_details and I have the following template code

    {exp:channel:entries channel="account_details" limit="1" dynamic="no" search:vz_member_field="={member_id}"}

    which outputted nothing. I also tried logged_in_member_id with the same results. I ended up creating an embed and having the {member_id} passed to the embed which also had the same results. Finally from a suggestion of another user I used the following code

    {embed="embed/.account_details" mem_id="{exp:member:custom_profile_data}{member_id}{/exp:member:custom_profile_data}"}
    <!-- Embed Template -->
    {exp:channel:entries channel="account_details" limit="1" dynamic="no" search:vz_member_field="={embed:mem_id}"}

    I was wondering if anyone could chime in with what might of been causing the problem so that I can make sure I don’t make similar mistakes in the future. Thanks.

  • #2 / Jan 13, 2011 8:24pm

    Rob Sanchez

    335 posts

    What about PHP enabled on input:

    {exp:channel:entries channel="account_details" limit="1" dynamic="no" search:vz_member_field="=<?php echo $this->EE->session->userdata('member_id'); ?>"}
  • #3 / Jan 14, 2011 2:18am

    Justin Long

    196 posts

    Rob that would work. I am already using PHP on output though in this particular template.

    I am assuming that my problem with just adding {member_id} is because of EE’s parsing order but I just wanted to make sure that was the isssue.

  • #4 / Jan 14, 2011 9:48am

    Ingmar

    29245 posts

    Yes, it’s a parse order issue. Rob’s approach (thanks for stepping in!) would be the one to make it work.

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

ExpressionEngine News!

#eecms, #events, #releases