راکت
حل شده

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

2 پاسخ

سلام دوستان من میخوام توی قالبم از اسکیما استفاده کنم که یک کد 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>```
ثبت پرسش جدید

پاسخ‌ها

2
حسام موسوی
حسام موسوی
@hesammousavi

تخصص: طراح و برنامه نویس

بهترین پاسخ

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

markazfa
markazfa
@markazfa

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

شاید پاسخ شما همین‌جا باشد

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

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