How to make line breaks in text in Gallery image comments
Posted: Fri May 03, 2013 9:31 am
Using Gallery module as a kind of blog tool – problems with text in Gallery image comments (line breaks etc)
I want to make a simple page for a client, that will work as a kind of newspage. It should be easy to add one image with a textblog. The latest added news/text should show at the top of the page.
I have made this page with the news module. But it doesn´t work for my client, as they dont know how to resize images. (!!)
So now I came up with the idea of making it with Gallery – using Lightbox template. I set the image size to a fixed size using the scale method.
I use the ”title” field for the headline of the news, the ”comment” field for the textarea.
But when you use line breaks in the text in the comment field, it wont show.
And html tags neither </br> though I want to avoid using html because of the client.
I would appreciate, if someone knows how to modify the comment field for images so I can use shift/line breaks?
Thanks a lot..
Marie
This is my Gallery template:
<div class="gallery">
{if !empty($gallerycomment)}<div class="gallerycomment">{$gallerycomment}</div>{/if}
{foreach from=$images item=image}
<div class="billeder">
<div class="image">
{if $image->isdir}
<img src="{$image-> thumb|escape:'url'|replace:'%2F':'/'}"
alt="{$image->title}" />
{else}
<img src="{$image->thumb}" alt="{$image->title}" />
{/if}
</div>
<div class="indhold">
{if !empty($image->titlename)}
<div class="titlename">{$image->titlename}</div>
{/if}
{if !empty($image->comment)}
<div class="imagecomment">{$image->comment}</div>
{/if}
</div>
<div class="galleryclear"> </div>
</div>
{/foreach}
</div>
I want to make a simple page for a client, that will work as a kind of newspage. It should be easy to add one image with a textblog. The latest added news/text should show at the top of the page.
I have made this page with the news module. But it doesn´t work for my client, as they dont know how to resize images. (!!)
So now I came up with the idea of making it with Gallery – using Lightbox template. I set the image size to a fixed size using the scale method.
I use the ”title” field for the headline of the news, the ”comment” field for the textarea.
But when you use line breaks in the text in the comment field, it wont show.
And html tags neither </br> though I want to avoid using html because of the client.
I would appreciate, if someone knows how to modify the comment field for images so I can use shift/line breaks?
Thanks a lot..
Marie
This is my Gallery template:
<div class="gallery">
{if !empty($gallerycomment)}<div class="gallerycomment">{$gallerycomment}</div>{/if}
{foreach from=$images item=image}
<div class="billeder">
<div class="image">
{if $image->isdir}
<img src="{$image-> thumb|escape:'url'|replace:'%2F':'/'}"
alt="{$image->title}" />
{else}
<img src="{$image->thumb}" alt="{$image->title}" />
{/if}
</div>
<div class="indhold">
{if !empty($image->titlename)}
<div class="titlename">{$image->titlename}</div>
{/if}
{if !empty($image->comment)}
<div class="imagecomment">{$image->comment}</div>
{/if}
</div>
<div class="galleryclear"> </div>
</div>
{/foreach}
</div>