Forum
Regions textblock vs codeblock
Hello,
I'm trying to make a paragraph and a ul dynamic. When creating the region, if I select 'Textblock, this will output all the HTML markup and tags (it treats all the content as plain text). If I charge the region by selecting 'code block' the content output does not contain the markup.
Is there a way of making a textblock region accept HTML markup without converting this to plain text ? or should I continue using the code block region?
below is my content that I paste into the region
<p>
Hello this is a test
</p>
<ul class="listgfx">
<li><span class="icon-coggreen"></span>item1.</li>
<li><span class="icon-coggreen"></span>item2. </li>
<li><span class="icon-coggreen"></span>item3.</li>
</ul>
Many thanks,
I would create a template like this:
Thanks Drew,
1) I created a new template by copying and pasting the code from your reply and called this 'new template'.
2) I created a region and selected the 'new template'
3) I pasted the following into the text area,
However, the Web page still treats this as plain text and displays all the markup
Am I missing something obvious, have I misunderstood how templates work ?
Can i continue using the code block template? this seems to work well. it keeps my markup aligned as it was pasted and is much easier to edit. I assume there aren't any negative outcomes of using this region?
Thanks,
When editing your regions, you should see a text field and a repeater.
In the test field, enter:
On the repeater, click the Add button and enter
Click the Add button again and enter
Save the region.
thanks drew, that works
my final question is , if I want to add a class to the paragraph , I assume I can amend the temple?
<perch:content id="para" class="myclass" type="textarea" markdown="true" editor="markitup" label="Paragraph" size="m" />
You would add the class to the <p> tag:
Thanks John,
is there any reason not to use the code region ? seems much easier and the markup stays aligned when you inspect source
You can't actually do that, as you'll end up with one
p
tag nested inside the other.Better to go with: