markazfa
3 سال پیش توسط markazfa مطرح شد
2 پاسخ

داینامیک کردن مقادیر json برای اسکیما

سلام دوستان من میخوام توی قالبم از اسکیما استفاده کنم که یک کد json رو باید تو کد های صفحه single یا مطلب سایتم قرار بدم اما مقادیر این json استاتیک هست . آیا راهی هست که مقادیر رو داینامیک کرد مثلا متن بین تگ div رو بگیره و توی کد json قرار بده؟!
کد json که سایت اسکیما میده :


{
  "@context": "https://schema.org",
  "@type": "Recipe",
  "author": "John Smith",
  "cookTime": "PT1H",
  "datePublished": "2009-05-08",
  "description": "This classic banana bread recipe comes from my mom -- the walnuts add a nice texture and flavor to the banana bread.",
  "image": "bananabread.jpg",
  "recipeIngredient": [
    "3 or 4 ripe bananas, smashed",
    "1 egg",
    "3/4 cup of sugar"
  ],
  "interactionStatistic": {
    "@type": "InteractionCounter",
    "interactionType": "https://schema.org/Comment",
    "userInteractionCount": "140"
  },
  "name": "Mom's World Famous Banana Bread",
  "nutrition": {
    "@type": "NutritionInformation",
    "calories": "240 calories",
    "fatContent": "9 grams fat"
  },
  "prepTime": "PT15M",
  "recipeInstructions": "Preheat the oven to 350 degrees. Mix in the ingredients in a bowl. Add the flour last. Pour the mixture into a loaf pan and bake for one hour.",
  "recipeYield": "1 loaf",
  "suitableForDiet": "https://schema.org/LowFatDiet"
}
</script>```

ثبت پرسش جدید
حسام موسوی
تخصص : طراح و برنامه نویس
@hesammousavi 3 سال پیش مطرح شد
0

درود بر شما داینامیک کردن یعنی با استفاده از زبان سرور اینکارو انجام دادن بهتر هست از یک زبان سمت سرور استفاده کنید و داینامیک کنید بر اساس اطلاعاتی که در سمت سرور ذخیره کردید


markazfa
@markazfa 3 سال پیش آپدیت شد
0

متشکر آقای موسوی بابت راهنماییتون


برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام