Advertisement
Shoporama

SEO FAQ ud fra

Aug 22nd, 2022
2,248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 3.74 KB | None | 0 0
  1. <{* SEO FAQ *}>
  2.     <{if $product}>
  3.         <{if $product->getMetaValue('q1')}>
  4.             <{assign var="counter" value=1}>
  5.             <script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[
  6.             <{section name="i" start=1 loop=11 step=1}>
  7.                 <{assign var="qr" value="q"|cat:$counter}>
  8.                 <{assign var="an" value="a"|cat:$counter}>
  9.                 <{assign var="question" value=$product->getMetaValue($qr)}>
  10.                 <{assign var="answer" value=$product->getMetaValue($an)}>
  11.                 <{if $question}>
  12.                    <{if $counter>1}>,<{/if}>
  13.                    {"@type":"Question","name":"<{$question}>","acceptedAnswer":{"@type":"Answer","text":"<{$answer}>"}}
  14.                 <{/if}>
  15.                 <{math assign="counter" equation=x+1 x=$counter}>
  16.             <{/section}>
  17.             ]}</script>
  18.         <{/if}>
  19.     <{/if}>
  20.    
  21.     <{if $category}>
  22.         <{if $category->getMetaValue('q1')}>
  23.             <{assign var="counter" value=1}>
  24.             <script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[
  25.             <{section name="i" start=1 loop=11 step=1}>
  26.                 <{assign var="qr" value="q"|cat:$counter}>
  27.                 <{assign var="an" value="a"|cat:$counter}>
  28.                 <{assign var="question" value=$category->getMetaValue($qr)}>
  29.                 <{assign var="answer" value=$category->getMetaValue($an)}>
  30.                 <{if $question}>
  31.                    <{if $counter>1}>,<{/if}>
  32.                    {"@type":"Question","name":"<{$question}>","acceptedAnswer":{"@type":"Answer","text":"<{$answer}>"}}
  33.                 <{/if}>
  34.                 <{math assign="counter" equation=x+1 x=$counter}>
  35.             <{/section}>
  36.             ]}</script>
  37.         <{/if}>
  38.     <{/if}>
  39.    
  40.     <{if $landing_page}>
  41.         <{if $landing_page->getMetaValue('q1')}>
  42.             <{assign var="counter" value=1}>
  43.             <script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[
  44.             <{section name="i" start=1 loop=11 step=1}>
  45.                 <{assign var="qr" value="q"|cat:$counter}>
  46.                 <{assign var="an" value="a"|cat:$counter}>
  47.                 <{assign var="question" value=$landing_page->getMetaValue($qr)}>
  48.                 <{assign var="answer" value=$landing_page->getMetaValue($an)}>
  49.                 <{if $question}>
  50.                    <{if $counter>1}>,<{/if}>
  51.                    {"@type":"Question","name":"<{$question}>","acceptedAnswer":{"@type":"Answer","text":"<{$answer}>"}}
  52.                 <{/if}>
  53.                 <{math assign="counter" equation=x+1 x=$counter}>
  54.             <{/section}>
  55.             ]}</script>
  56.         <{/if}>
  57.     <{/if}>
  58.    
  59.     <{if $page}>
  60.         <{if $page->getMetaValue('q1')}>
  61.             <{assign var="counter" value=1}>
  62.             <script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[
  63.             <{section name="i" start=1 loop=11 step=1}>
  64.                 <{assign var="qr" value="q"|cat:$counter}>
  65.                 <{assign var="an" value="a"|cat:$counter}>
  66.                 <{assign var="question" value=$page->getMetaValue($qr)}>
  67.                 <{assign var="answer" value=$page->getMetaValue($an)}>
  68.                 <{if $question}>
  69.                    <{if $counter>1}>,<{/if}>
  70.                    {"@type":"Question","name":"<{$question}>","acceptedAnswer":{"@type":"Answer","text":"<{$answer}>"}}
  71.                 <{/if}>
  72.                 <{math assign="counter" equation=x+1 x=$counter}>
  73.             <{/section}>
  74.             ]}</script>
  75.         <{/if}>
  76.     <{/if}>
  77.    
  78.     <{if $blogpost}>
  79.         <{if $blogpost->getMetaValue('q1')}>
  80.             <{assign var="counter" value=1}>
  81.             <script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[
  82.             <{section name="i" start=1 loop=11 step=1}>
  83.                 <{assign var="qr" value="q"|cat:$counter}>
  84.                 <{assign var="an" value="a"|cat:$counter}>
  85.                 <{assign var="question" value=$blogpost->getMetaValue($qr)}>
  86.                 <{assign var="answer" value=$blogpost->getMetaValue($an)}>
  87.                 <{if $question}>
  88.                    <{if $counter>1}>,<{/if}>
  89.                    {"@type":"Question","name":"<{$question}>","acceptedAnswer":{"@type":"Answer","text":"<{$answer}>"}}
  90.                 <{/if}>
  91.                 <{math assign="counter" equation=x+1 x=$counter}>
  92.             <{/section}>
  93.             ]}</script>
  94.         <{/if}>
  95.     <{/if}>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement