Creating a block with lists
Permalink Browser Info Environment
I can see there is no direct way of adding an unordered or ordered list, so I was wondering what would be the best way to do this. Adding the opening and closing UL/OL tags as static html and then the list elements as text fields would do, but the number of list elements would be the static.
Any other way or ideas ?
Any other way or ideas ?
Type: | Discussion |
---|---|
Status: | New |
Worked like a charm, thanks ! Now, is there a way to input html tags into any filed (textbox, textarea) when editing the content ? For small things as <strong> or <em> ?
Thanks again
Thanks again
Sure, just edit the view.php file of the block after you've created it and remove all calls to the "htmlentities" function. For example, if you see something like this:
...you would change it to this:
Although note that ideally you should probably use the "WYSIWYG" field when you want to allow rich text because then your end-users can just use the editing toolbar instead of having to know what the html codes are.
<?php echo htmlentities($field_2_textarea_text, ENT_QUOTES, APP_CHARSET); ?>
...you would change it to this:
<?php echo $field_2_textarea_text; ?>
Although note that ideally you should probably use the "WYSIWYG" field when you want to allow rich text because then your end-users can just use the editing toolbar instead of having to know what the html codes are.
This sounds like a perfect solution for something I've been looking for. However, when I follow the steps, all I get is an empty <li></li>. Do I need to be using a special markup in the text area when I am adding/editing this block?
Nevermind, I figured out what was up. Stupid mistake. That's what I get for working late at night.
Works like a charm now. Thanks for all your hard work Jordan.
Works like a charm now. Thanks for all your hard work Jordan.
But if that's overkill for your situation and you're only dealing with simple text info, you could make a block with Designer Content that has a "Text Area" field, then after you've generated the field, edit the block's view.php file, find this code:
...and change it to this:
(in addition to putting the "<ul>" and "</ul>" tags as static HTML surrounding it)