I am new to the use of Frontity, but I do have a few questions, I hope this is the right place for it!.
Can someone explain me how to :
List products with Frontity.
Show variable products with Frontity
The use of REST API in Frontity.
Here is where you put in the API - its basically just your website URL plus wp-json.
"name": "#frontity/wp-source",
"state": {
"source": {
"api": "https://test.frontity.org/wp-json"
}
Related
Thumbnails from external urls are not loading. However, the post inspector tool loads it just fine.
Page I used to perform some tests: https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html
Things I've tried so far:
Add an extra parameter at the end of the url in order to clear linkedin cache.
Post Inspector Tool
I did some research but I wasn't successful on finding a solution.
I created a post using different links like youtube and stackoverflow. Thumbnails didn't show up either.
I made sure each page has those required meta(open graph) tags that allows the crawler to retrieve information.
Here's an example of one of those API requests I've been calling to(I got this from the docs):
`
{
"author": "urn:li:person:{ID}",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "Learning more about LinkedIn by reading the LinkedIn Blog!"
},
"shareMediaCategory": "ARTICLE",
"media": [
{
"status": "READY",
"description": {
"text": "Official LinkedIn Blog - Your source for insights and information about LinkedIn."
},
"originalUrl": "https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html",
"title": {
"text": "Official LinkedIn Blog"
}
}
]
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
`
In the Share Media object, you're missing the media attribute. It accepts LinkedIn URN so you'll need to upload the image. Personally, I'm not using that attribute but thumbnails that accepts image url. I don't see it in the docs anymore so something might have been changed. At least it's still working for me and I haven't seen it deprecated in the changelog yet. Be careful with the image requirements as well. It accepts an image url with this signature
{
...,
"thumbnails": [{
"url": "https://image-url.com"
}]
}
In Drupal 8/9. Need to capture data including 'attributes', 'type' and custom created group 'translate' when other party using jsonapi POST menthod to create articles in my site. This should be captured in custom module.
For Example here is the payload:
{
"data": {
"type": "node--cars",
"attributes": {
"title": "Test article flow 1"
"body": "This is custom body"
},
"relationships": {
},
"translate": {
"custom_field1": "Text 1",
"custom_field2": "Text 2"
}
}
}
API point fo this is "/jsonapi/node/cars". So actually before the 'cars' node is created need to capture "custom_field1" and "custom_field2" in "translate" so that need to write custom validation from custom module. Tried creating normalizer "TypedDataNormalizer" and "ContentEntityNormalizer" and in "normalize" class getting data. But its empty and its not calling this normalizer. Can someone please help me in this case how to achieve this. Thanks in advance
I try to retrieve a thumbnails for a Video Post with the ugcPost api without any success.
I retrieve always an empty array for thumbnails.
Regarding the doc Retrieve UGC Posts, like the sample response:
"com.linkedin.ugc.ShareContent": {
"media": [
{
"media": "urn:li:digitalmediaAsset:123ABDEFHAG",
"status": "READY",
"thumbnails": []
}
],
Any idea about how to retrieve a thumbnails with some projection or using the digitalmediaAsset urn?
EDIT: I've already tried this https://stackoverflow.com/a/58401470/2270041 without any success
According to the docs this is not possible, simply stating
Video thumbnails are not retrievable.
I'm trying to create a UGC post with video asset. I'm able to upload the video and get the media id. but when I'm trying to create the UGC post with the media id, I'm getting a permission error:
urn:li:developerApplication: does not have permission to create ugc posts
Although I am able to create UGC post with an image without any errors.
api url: https://api.linkedin.com/v2/ugcPosts
request budy:
{
"author":"urn:li:organization:",
"lifecycleState":"PUBLISHED",
"specificContent":{
"com.linkedin.ugc.ShareContent":{
"media":[
{
"description":
{
"attributes":[],
"text":"Testing video upload."
},
"media":"urn:li:digitalmediaAsset:",
"status":"READY",
"thumbnails":[],
"title":
{
"attributes":[],
"text":""
}
}
],
"shareCommentary":{
"attributes":[],
"text":"Testing video upload."
},
"shareMediaCategory":"VIDEO"
}
},
"targetAudience":{
"targetedEntities":[]
},
"visibility":{
"com.linkedin.ugc.MemberNetworkVisibility":"PUBLIC"
}
}
Apparently only a few / whitelisted apps can create video UGC posts: https://stackoverflow.com/a/54934631/7844946
I have 2 roles in my app. Users and doctors.
I want that a doctor can edit extra fields like picture and text field on an extra profile page for doctors.
How to add this fields probably not to the profile but to an extra part of the users collection and make it then public availible as a profile page /doctor/_id
I am now experimenting with meteorkitchen, which is great, but when I add a profile.doctor.field1 and show this on an page like user_settings/profile/doctor and update it the other fields of the profile are overwritten with empty values. I assume it assumes that all profile attributes are edited on one form and when one field is empty so it deletes them. But this is not what I want.
(Can someone add a tag meteorkitchen please. I have not enough reputation. thanks)
Edit:
this are the settings for the router
var roleMap = [
...
{ route: "user_settings.doctor", roles: ["doctor","admin"] }
];
and attached this part for the form
"name": "edit_form",
"type": "form",
"mode": "update",
"title": "Edit your doctor profile",
"submit_route": "user_settings.profile.doctor",
"query": {
"name": "current_user_data",
"collection": "users",
"filter": {
"_id": "Meteor.userId()"
},
"find_one": true,
"options": {},
"params": []
},
"fields": [
{
"name": "profile.doctor.quote",
"title": "Favorite quote",
"type": "string",
"required": true
}
]
the problem is that on update some of the profile values the others are deleted.
If you want to stick with Meteor Kitchen, here is how I would proceed.
First, you need to create a "doctor" role. See your application page on kitchen designer, you can add it here.
Second, you need to add your new "doctor" role to the page roles. You can do it directly in the role map located in client/views/router.js or using the designer.
EDIT Following the discussion in the comments here is an update:
You can change the collection name directly in the section "Edit source" of the designer. You go to your page, in the query, you set
"query": {
"name": "doctor_user",
"collection": "users",
"filter": {
"_id": ":userId"
},
"find_one": false,
"options": {},
"params": []
},
The thing is that even if you do that, only admins can update the users collection. So you need to download the user-roles package from perak, put it inside your project (only put the folders) and remove the user-roles pre-installed package (meteor remove perak:user-roles).
Once you have done that, go to server/collections and replace the update part of users.js with that:
update: function (userId, doc, fieldNames, modifier) {
return Users.isInRole ("admin")|| (Users.isInRole ("doctor") &&
!_.contains(fieldNames,'roles')));
It will allow users with the doctor role to update any user field except for the "roles" field.
Last step, you edit the server\publications\users.js file and add this in it:
Meteor.publish("doctor_user", function(_id){
return Users.isInRoles ({"doctor", "admin"}) ? Users.find({_id: _id}) : this.ready();
});