1

I have to put main heading in <h2> tag. I have written following line of code

<li>&lt;h2&gt;
@@GetResourceComponentFieldValueByWebDavURL('Building%20Blocks/Content/brand_xxx/Config/Resource.xml','Resource','RecipeDetail_Ingredient')@@
&lt;/h2&gt;</li>
  • it reads label of RecipeDetail_Ingredient from resource Component for brand_xxx . However I can see <h2> tags are appearing but they are being treated as sting rather than html tag and browser in showing them on the site. Anyone is having idea what wrong is here? below is snippet how it appears on site..

enter image description here

5
  • Is h2 actually part of the content in the resource component field?
    – Nuno Linhares
    Commented Jan 20, 2014 at 11:10
  • No. It's hard coded in dwt and also I used &lt; and &gt; . Here stackexchange make it <h2> . Commented Jan 20, 2014 at 11:13
  • are there any other TBB's being executed in your Component Template or Page Template after the Dreamweaver TBB?
    – Puntero
    Commented Jan 20, 2014 at 11:16
  • That's a good point @Puntero - try running it in Template Builder and check the result after the DWT (click on the DWT TBB and check the Output variable), then check again after the other TBBs.
    – Nuno Linhares
    Commented Jan 20, 2014 at 11:18
  • My guess would be that other TBB is modifying the output variable and pushing it back with the wrong ContentType
    – Puntero
    Commented Jan 20, 2014 at 11:19

2 Answers 2

3

For outputting HTML in a DWT Template, you need to normally write the tags, so just use:

<h2>
@@GetResourceComponentFieldValueByWebDavURL(...)@@
</h2>

When you start using &lt; and &gt;, it will remain that way and then instead of an <h2> tag, you will see the tag written out on the website.

1
  • Thanks Bart. It worked as per your suggestion. I shouldn't be more cautious for html handling. Commented Jan 20, 2014 at 11:43
0

I remember that I come across similar problem. I followed below steps:

  • On the DWT, place proper HTML
<li>
  <h2>
      @@GetResourceComponentFieldValueByWebDavURL('Building%20Blocks/Content/brand_xxx/Config/Resource.xml','Resource','RecipeDetail_Ingredient')@@
  </h2>
</li>
  • Make sure, page template output is UTF-8
  • Make sure, if any C# fragments are executing after DWT that are converting to &lt;
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.