DataSrc:DemoJan25/StrapiPublic-Disseminations: Difference between revisions

    From UNITApedia
    (Created page with "== Strapi Events Display == <!-- 1) Fetch the data with #get_web_data --> {{#get_web_data: |url = https://unitapedia.univ-unita.eu/strapi/api/events?populate=events,SupplementaryInfo |format = json |data = EventID = id, CreatedAt = createdAt, UpdatedAt = updatedAt, PublishedAt = publishedAt, EventType = Type, Participants = Participants, Certificate = Certificate, Category = Category, EventDa...")
     
    No edit summary
     
    (13 intermediate revisions by 2 users not shown)
    Line 1: Line 1:
    == Strapi Events Display ==
    <!-- 1) Fetch the data with #get_web_data -->
    {{#get_web_data:
    {{#get_web_data:
       |url    = https://unitapedia.univ-unita.eu/strapi/api/events?populate=events,SupplementaryInfo
       |url    = https://unitapedia.univ-unita.eu/strapi/api/public-disseminations?populate=*,Dissemination.social-media
       |format  = json
       |format  = json
       |data    =  
       |data    =  
         EventID      = id,
         DisseminationID      = id,
         CreatedAt    = createdAt,
         EntryDate            = EntryDate,
        UpdatedAt    = updatedAt,
         Platform            = platform,
        PublishedAt  = publishedAt,
         Views                = views,
         EventType    = Type,
         GainedFollowers     = gained_followers,
         Participants  = Participants,
         Followers            = followers,
         Certificate  = Certificate,
         Activities          = activities
        Category     = Category,
         EventDate    = Date,
         Publication  = Publication,
        Seminars      = Seminars,
        Workshops    = Workshops
       |debug  = 1
       |debug  = 1
    }}
    }}


    <!-- 2) Display the data -->
    <!-- Store each dissemination as a subobject -->
    {{#if:{{#external_value:EventID}} |
    {{#store_external_table: StrapiPublicDissemination
       === Event Details ===
       |DisseminationID      = {{{DisseminationID}}}
      * **Event ID:** {{#external_value:EventID}}
       |EntryDate            = {{{EntryDate}}}
       * **Created At:** {{#external_value:CreatedAt}}
       |Platform            = {{{Platform}}}
       * **Updated At:** {{#external_value:UpdatedAt}}
       |Views                = {{{Views}}}
       * **Published At:** {{#external_value:PublishedAt}}
       |GainedFollowers      = {{{GainedFollowers}}}
     
       |Followers            = {{{Followers}}}
       * **Type:** {{#external_value:EventType}}
       |Activities          = {{{Activities}}}
       * **Participants:** {{#external_value:Participants}}
    }}
       * **Certificate:** {{#external_value:Certificate}}
      * **Category:** {{#external_value:Category}}
      * **Date:** {{#external_value:EventDate}}


      * **Publication:** {{#external_value:Publication}}
    <!-- Query and display all dissemination records in a table -->
      * **Seminars:** {{#external_value:Seminars}}
    {{#ask: [[-Has subobject::{{FULLPAGENAME}}]]
      * **Workshops:** {{#external_value:Workshops}}
    |?DisseminationID
    |  
    |?EntryDate
      * **Error:** Unable to retrieve event data. Check the debug output below.
    |?Platform
    |?Views
    |?GainedFollowers
    |?Followers
    |?Activities
    |format=table
    |class=datatable
    |format=datatables
    |mainlabel=-
    |header=show
    }}
    }}

    Latest revision as of 13:53, 28 January 2025