Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-24051

Unable to view Contents on frontend of new Content Types created via REST

    XMLWordPrintable

    Details

      Description

      I tried creating several content types via REST, using session-based authentication, on REST Client.
      For one in specific (the simplest I could think of), I used the following REST parameters:

      Method:
      POST
      
      URL:
      http://ezp5.dev.vagrant/api/ezp/v2/content/typegroups/3/types?publish=true
      
      Headers:
      Accept:
      application/vnd.ez.api.ContentType
      
      Content-Type:
      application/vnd.ez.api.ContentTypeCreate
      
      Body:
      <?xml version="1.0" encoding="UTF-8"?>
      <ContentTypeCreate>
          <identifier>rest_dummy</identifier>
          <names>
              <value languageCode="eng-GB">Rest Dummy</value>
          </names>
          <descriptions>
              <value languageCode="eng-GB">dummy rest-created content type</value>
          </descriptions>
          <remoteId>remoteId-qwert550</remoteId>
          <urlAliasSchema>&lt;name&gt;</urlAliasSchema>
          <nameSchema>&lt;title&gt;</nameSchema>
          <isContainer>false</isContainer>
          <mainLanguageCode>eng-GB</mainLanguageCode>
          <defaultAlwaysAvailable>true</defaultAlwaysAvailable>
          <defaultSortField>PATH</defaultSortField>
          <defaultSortOrder>ASC</defaultSortOrder>
          <FieldDefinitions>
              <FieldDefinition>
                  <identifier>name</identifier>
                  <fieldType>ezstring</fieldType>
                  <fieldGroup>content</fieldGroup>
                  <position>10</position>
                  <isTranslatable>true</isTranslatable>
                  <isRequired>false</isRequired>
                  <isInfoCollector>false</isInfoCollector>
                  <defaultValue></defaultValue>
                  <isSearchable>true</isSearchable>
                  <names>
                      <value languageCode="eng-GB">Name</value>
                  </names>
                  <descriptions>
                      <value languageCode="eng-GB">This is the title</value>
                  </descriptions>
              </FieldDefinition>
          </FieldDefinitions>
      </ContentTypeCreate>
      

      I noticed then that the content type was successfully created (in this case, inside default 'Media' Content Type Group).
      However I found out that even though I can create contents of this new Content Type, I cannot see them on frontend.
      Since now Legacy is gone on master, the only method we can create new Content Types is via REST or the Public API, AFAIK.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rui.silva-obsolete@ez.no Rui Silva (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: