• Resolved josephmarkovich

    (@josephmarkovich)


    Do I need to use the premium version of the plugin to be able to pass a GUID from a list of records to a detail page?

    I was reading previous forum posts and I feel like it’s possible, but when I try it, I just get a blank page back.

    My FetchXML is correct — since it runs in FetxhXML Builder just fine — but even hard coding the GUID in the condition returns no results.

    This is all of my Twig and HTML:

    {% set projectid = request.params['id'] %}
    {% fetchxml collection="project" %}
    <fetch mapping="logical" returntotalrecordcount="true">
       <entity name="jcma_project">
          <attribute name="jcma_projectid" />
          <attribute name="jcma_name" />
          <attribute name="jcma_difficulty" />
          <attribute name="jcma_projectdescription" />
          <attribute name="jcma_requiredpreferredskills" />
          <attribute name="jcma_city" />
          <attribute name="jcma_stateprovince" />
          <filter type="and">
             <condition attribute="jcma_projectid" operator="eq" value="{{ projectid }}" />         
          </filter>
       </entity> 
    </fetch>
    {% endfetchxml %}
    
    {% for projectdetail in project.entities.results %}
    <div>
       <h1>{{ projectdetail["jcma_name"] }}</h1><br>
       <i>{{ projectdetail["jcma_city"] }}, {{ projectdetail | formatted_value(["jcma_stateprovince"]) }}</i>
    </div>
    <div>
       <h3>Description</h3><br>
       <p>{{ projectdetail["jcma_projectdescription"] }}</p>
    </div>
    <div>
       <h3>Required or Preferred Skills</h3><br>
       <p>{{ projectdetail["jcma_requiredpreferredskills"] }}</p>
    </div>
    {% endfor %}

    Any assistance would be appreciated.
    Joe

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author alexacrm

    (@alexacrm)

    @josephmarkovich

    check what fetchxml is generated:

    <pre>{{ project.xml }}</pre>

    If same fetchxml returns records in FechXmlBuilder, check the permissions on the account you use to connect to WordPress.

    Thread Starter josephmarkovich

    (@josephmarkovich)

    Thanks for the reminder about permissions! This fixed another issue I was having and forgot about that.

    Ran the FetchXML in FetchXML Builder that was generated from <pre>{{ project.xml }}</pre> and it’s returning an error “expected non-empty string.”

    I don’t know what that means. I’ve recreated the FetchXML in FetchXML Builder and copy/pasted back to the WordPress page. Still blank.

    I know this is something silly I am missing here.

    Joe

    Plugin Author alexacrm

    (@alexacrm)

    @josephmarkovich

    what’s the output of {{project.xml}}?

    If query from the builder returns no records in PHP, 9 out of 10 it’s permissions. If you are 100% confident permissions are correct, there must be something else going on and the Debug log (see About tab) will have some additional details.

    Having said all that, you have a single record, why do you use fetchxml at all? Your record is available as {% set project = entities.jcma_project[projectid] %} and then you can use {{ project.jcma_name }}, {{ project.jcma_city }}, etc

    • This reply was modified 2 years, 6 months ago by alexacrm.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Passing GUID in querystring’ is closed to new replies.